1 package org.gnomekr.potron.data;
2
3 import java.io.Serializable;
4 import java.util.Date;
5 import java.util.Set;
6
7 import org.apache.commons.lang.builder.HashCodeBuilder;
8 import org.apache.commons.lang.builder.ToStringBuilder;
9
10 /***
11 * Project.java
12 * @author Xavier Cho
13 * @version $Revision 1.1 $ $Date: 2005/07/21 10:04:42 $
14 * @hibernate.class table = "POTRON_PROJECT"
15 * @hibernate.cache usage = "nonstrict-read-write"
16 */
17 public class Project implements Serializable {
18
19 private static final long serialVersionUID = 3276800820199015080L;
20
21 private String id;
22 private String name;
23 private String version;
24 private String description;
25 private Date registeredDate;
26 private String homepage;
27 private Set<Template> templates;
28
29 public Project() {
30 }
31
32 /***
33 * @param id
34 */
35 public Project(String id) {
36 this.id = id;
37 }
38
39 /***
40 * @return
41 * @hibernate.id
42 * column = "project_id"
43 * length = "20"
44 * unsaved-value = "null"
45 * generator-class = "assigned"
46 */
47 public String getId() {
48 return id;
49 }
50
51 /***
52 * @return
53 * @hibernate.property
54 * column = "version"
55 * length = "20"
56 * update = "true"
57 * not-null = "true"
58 */
59 public String getVersion() {
60 return version;
61 }
62
63 /***
64 * @return
65 * @hibernate.property
66 * column = "description"
67 * length = "800"
68 * update = "true"
69 * not-null = "false"
70 */
71 public String getDescription() {
72 return description;
73 }
74
75 /***
76 * @return
77 * @hibernate.property
78 * column = "homepage"
79 * length = "100"
80 * update = "true"
81 * not-null = "false"
82 */
83 public String getHomepage() {
84 return homepage;
85 }
86
87 /***
88 * @return
89 * @hibernate.property
90 * column = "name"
91 * length = "50"
92 * update = "true"
93 * not-null = "true"
94 */
95 public String getName() {
96 return name;
97 }
98
99 /***
100 * @return
101 * @hibernate.property
102 * column = "reg_date"
103 * update = "false"
104 * not-null = "true"
105 */
106 public Date getRegisteredDate() {
107 return registeredDate;
108 }
109
110 /***
111 * @return
112 * @hibernate.collection-one-to-many
113 * class = "org.gnomekr.potron.data.Template"
114 * @hibernate.collection-key
115 * column = "project_id"
116 * @hibernate.set
117 * lazy = "true"
118 * inverse = "true"
119 * order-by = "template_id"
120 * cascade = "all-delete-orphan"
121 */
122 public Set<Template> getTemplates() {
123 return templates;
124 }
125
126 /***
127 * @param description
128 */
129 public void setDescription(String description) {
130 this.description = description;
131 }
132
133 /***
134 * @param homepage
135 */
136 public void setHomepage(String homepage) {
137 this.homepage = homepage;
138 }
139
140 /***
141 * @param id
142 */
143 public void setId(String id) {
144 this.id = id;
145 }
146
147 /***
148 * @param name
149 */
150 public void setName(String name) {
151 this.name = name;
152 }
153
154 /***
155 * @param registeredDate
156 */
157 public void setRegisteredDate(Date registeredDate) {
158 this.registeredDate = registeredDate;
159 }
160
161 /***
162 * @param templates
163 */
164 public void setTemplates(Set<Template> templates) {
165 this.templates = templates;
166 }
167
168 /***
169 * @param version
170 */
171 public void setVersion(String version) {
172 this.version = version;
173 }
174
175 /***
176 * @see java.lang.Object#equals(java.lang.Object)
177 */
178 public boolean equals(final Object object) {
179 if (object instanceof Project) {
180 String value = ((Project) object).getId();
181 return id.equals(value);
182 }
183
184 return false;
185 }
186
187 /***
188 * @see java.lang.Object#toString()
189 */
190 public String toString() {
191 ToStringBuilder builder = new ToStringBuilder(this);
192 builder.append("id", id);
193 builder.append("name", name);
194 builder.append("version", version);
195
196 return builder.toString();
197 }
198
199 /***
200 * @see java.lang.Object#hashCode()
201 */
202 public int hashCode() {
203 HashCodeBuilder builder = new HashCodeBuilder();
204 builder.append(id);
205
206 return builder.toHashCode();
207 }
208 }