View Javadoc

1   /*
2    * Created on Nov 27, 2004
3    *
4    * TODO To change the template for this generated file go to
5    * Window - Preferences - Java - Code Style - Code Templates
6    * 
7    *
8    */
9   package com.panogenesis.model;
10  
11  import java.io.Serializable;
12  import java.util.HashSet;
13  import java.util.Set;
14  
15  import org.apache.commons.lang.builder.EqualsBuilder;
16  import org.apache.commons.lang.builder.HashCodeBuilder;
17  import org.apache.commons.lang.builder.ToStringBuilder;
18  /***
19   * @author John Arthur
20   *
21   * TODO To change the template for this generated type comment go to
22   * Window - Preferences - Java - Code Style - Code Templates
23   * 
24   * @hibernate.class table="issue"
25   */
26  public class Issue extends BaseObject implements Serializable {
27      /*** The composite primary key value. */
28      private java.lang.Integer id;
29  
30      /*** The value of the simple severity property. */
31      private java.lang.Integer severity;
32  
33      /*** The value of the simple status property. */
34      private java.lang.Integer status;
35  
36      /*** The value of the simple resolution property. */
37      private Integer resolution;
38  
39      /*** The value of the simple description property. */
40      private java.lang.String description;
41  
42      /*** The value of the simple createDate property. */
43      private java.util.Date createDate;
44  
45      /*** The value of the simple lastModified property. */
46      private java.util.Date lastModified;
47  
48      /*** The value of the simple targetVersionId property. */
49      private java.lang.Integer targetVersionId;
50  
51      /*** The value of the simple creatorId property. */
52      private java.lang.String creatorId;
53  
54      /*** The value of the simple ownerId property. */
55      private java.lang.String ownerId;
56  
57      /*** The value of the simple projectId property. */
58      private java.lang.Integer projectId;
59      
60      private Set components = new HashSet();
61      private Set myCreatedIssues = new HashSet();
62      private Set myOwnedIssues = new HashSet();
63      private Set histories = new HashSet();
64      private Project project;
65      private String creatorName;
66      private String ownerName;
67  
68  	
69  	/***
70  	 * @return Returns the creatorName.
71  	 */
72  	public String getCreatorName() {
73  		return creatorName;
74  	}
75  	/***
76  	 * @param creatorName The creatorName to set.
77  	 */
78  	public void setCreatorName(String creatorName) {
79  		this.creatorName = creatorName;
80  	}
81  	/***
82  	 * @return Returns the ownerName.
83  	 */
84  	public String getOwnerName() {
85  		return ownerName;
86  	}
87  	/***
88  	 * @param ownerName The ownerName to set.
89  	 */
90  	public void setOwnerName(String ownerName) {
91  		this.ownerName = ownerName;
92  	}
93      /***
94       * Simple constructor of AbstractIssue instances.
95       */
96      public Issue()
97      {
98      }
99  
100     /***
101      * Constructor of Issue instances given a simple primary key.
102      * @param id
103      * 
104      */
105     public Issue(java.lang.Integer id)
106     {
107         this.setId(id);
108     }
109 
110     /***
111      * Return the simple primary key value that identifies this object.
112      * @return java.lang.Integer
113      * 
114      * @hibernate.id column="id"
115      *  generator-class="increment" unsaved-value="null"
116      */
117     public java.lang.Integer getId()
118     {
119         return id;
120     }
121 
122     /***
123      * Set the simple primary key value that identifies this object.
124      * @param id
125      */
126     public void setId(java.lang.Integer id)
127     {
128         this.id = id;
129     }
130 
131     /***
132      * Return the value of the severity column.
133      * @return java.lang.Integer
134      * 
135      * @hibernate.property column="severity" not-null="true"
136      * 
137      */
138     public java.lang.Integer getSeverity()
139     {
140         return this.severity;
141     }
142 
143     /***
144      * Set the value of the severity column.
145      * @param severity
146      * 
147      * @spring.validator type="required"
148      */
149     public void setSeverity(java.lang.Integer severity)
150     {
151         this.severity = severity;
152     }
153 
154     /***
155      * Return the value of the status column.
156      * @return java.lang.Integer
157      * 
158      * @hibernate.property column="issue_status" not-null="true" 
159      */
160     public java.lang.Integer getStatus()
161     {
162         return this.status;
163     }
164 
165     /***
166      * Set the value of the status column.
167      * @param status
168      * 
169      * @spring.validator type="required"
170      */
171     public void setStatus(java.lang.Integer status)
172     {
173         this.status = status;
174     }
175 
176     /***
177      * Return the value of the resolution column.
178      * @return java.lang.String
179      * @hibernate.property column="resolution" 
180      */
181     public java.lang.Integer getResolution()
182     {
183         return this.resolution;
184     }
185 
186     /***
187      * Set the value of the resolution column.
188      * @param resolution
189      */
190     public void setResolution(Integer resolution)
191     {
192         this.resolution = resolution;
193     }
194 
195     /***
196      * Return the value of the description column.
197      * @return java.lang.String
198      * @hibernate.property column="description" not-null="true" length="255"
199      */
200     public java.lang.String getDescription()
201     {
202         return this.description;
203     }
204 
205     /***
206      * Set the value of the description column.
207      * @param description
208      * 
209      * @spring.validator type="required"
210      */
211     public void setDescription(java.lang.String description)
212     {
213         this.description = description;
214     }
215 
216     /***
217      * Return the value of the create_date column.
218      * @return java.util.Date
219      * 
220      * @hibernate.property column="create_date"
221      */
222     public java.util.Date getCreateDate()
223     {
224         return this.createDate;
225     }
226 
227     /***
228      * Set the value of the create_date column.
229      * @param createDate
230      */
231     public void setCreateDate(java.util.Date createDate)
232     {
233         this.createDate = createDate;
234     }
235 
236     /***
237      * Return the value of the last_modified column.
238      * @return java.util.Date
239      * 
240      * @hibernate.property column="last_modified"
241      */
242     public java.util.Date getLastModified()
243     {
244         return this.lastModified;
245     }
246 
247     /***
248      * Set the value of the last_modified column.
249      * @param lastModified
250      */
251     public void setLastModified(java.util.Date lastModified)
252     {
253         this.lastModified = lastModified;
254     }
255 
256     /***
257      * Return the value of the target_version_id column.
258      * @return java.lang.Integer
259      * 
260      * @hibernate.property column="target_version_id"
261      */
262     public java.lang.Integer getTargetVersionId()
263     {
264         return this.targetVersionId;
265     }
266 
267     /***
268      * Set the value of the target_version_id column.
269      * @param targetVersionId
270      */
271     public void setTargetVersionId(java.lang.Integer targetVersionId)
272     {
273         this.targetVersionId = targetVersionId;
274     }
275 
276     /***
277      * Return the value of the creator_id column.
278      * @return java.lang.String
279      * 
280      * @hibernate.property column="creator_id" length="50"
281      */
282     public java.lang.String getCreatorId()
283     {
284         return this.creatorId;
285     }
286 
287     /***
288      * Set the value of the creator_id column.
289      * @param creatorId
290      */
291     public void setCreatorId(java.lang.String creatorId)
292     {
293         this.creatorId = creatorId;
294     }
295 
296     /***
297      * Return the value of the owner_id column.
298      * @return java.lang.String
299      * 
300      * @hibernate.property column="owner_id" length="50"
301      */
302     public java.lang.String getOwnerId()
303     {
304         return this.ownerId;
305     }
306 
307     /***
308      * Set the value of the owner_id column.
309      * @param ownerId
310      */
311     public void setOwnerId(java.lang.String ownerId)
312     {
313         this.ownerId = ownerId;
314     }
315 
316     /***
317      * Return the value of the project_id column.
318      * @return java.lang.Integer
319      * 
320      * @hibernate.property column="project_id" not-null="true"
321      */
322     public java.lang.Integer getProjectId()
323     {
324         return this.projectId;
325     }
326 
327     /***
328      * Set the value of the project_id column.
329      * @param projectId
330      * 
331      * 
332      */
333     public void setProjectId(java.lang.Integer projectId)
334     {
335         this.projectId = projectId;
336     }
337 
338 	/***
339 	 * @see java.lang.Object#equals(Object)
340 	 */
341 	public boolean equals(Object object) {
342 		if (!(object instanceof Issue)) {
343 			return false;
344 		}
345 		Issue rhs = (Issue) object;
346 		return new EqualsBuilder().append(
347 				this.creatorId, rhs.creatorId).append(this.projectId,
348 				rhs.projectId)
349 				.append(this.targetVersionId, rhs.targetVersionId).append(
350 						this.severity, rhs.severity).append(this.description,
351 						rhs.description).append(this.ownerId, rhs.ownerId)
352 				.append(this.lastModified, rhs.lastModified).append(
353 						this.createDate, rhs.createDate).append(
354 						this.resolution, rhs.resolution).append(this.status,
355 						rhs.status).append(this.id, rhs.id).isEquals();
356 	}
357 	/***
358 	 * @see java.lang.Object#hashCode()
359 	 */
360 	public int hashCode() {
361 		return new HashCodeBuilder(-28724385, 82251617).append(this.creatorId).append(this.projectId)
362 				.append(this.targetVersionId).append(this.severity).append(
363 						this.description).append(this.ownerId).append(
364 						this.lastModified).append(this.createDate).append(
365 						this.resolution).append(this.status).append(this.id)
366 				.toHashCode();
367 	}
368 	/***
369 	 * @see java.lang.Object#toString()
370 	 */
371 	public String toString() {
372 		return new ToStringBuilder(this).append("targetVersionId",
373 				this.targetVersionId).append("resolution", this.resolution)
374 				.append("description", this.description).append("id", this.id)
375 				.append("ownerId", this.ownerId).append("status", this.status)
376 				.append("lastModified", this.lastModified).append("severity",
377 						this.severity).append("creatorId", this.creatorId)
378 				.append("projectId", this.projectId).append("createDate",
379 						this.createDate).toString();
380 	}
381 	/***
382 	 * @return Returns the componets.
383 	 * @hibernate.set table="issue_component" cascade="all" lazy="false" 
384      * @hibernate.collection-key column="issue_id"
385      * @hibernate.collection-many-to-many class="com.panogenesis.model.Component"
386      * 				column="component_id"
387 	 */
388 	public Set getComponents() {
389 		return components;
390 	}
391 	/***
392 	 * @param componets The componets to set.
393 	 */
394 	public void setComponents(Set components) {
395 		this.components = components;
396 	}
397 
398 	/***
399 	 * @return Returns the myCreatedIssues.
400 	 *
401 	 */
402 	public Set getMyCreatedIssues() {
403 		return myCreatedIssues;
404 	}
405 
406 	/***
407 	 * @return Returns the myOwnedIssues.
408 	 * 
409 	 */
410 	public Set getMyOwnedIssues() {
411 		return myOwnedIssues;
412 	}
413 
414 
415 	/***
416 	 * @return Returns the histories.
417 	 * 
418 	 * @hibernate.set cascade="delete" lazy="false" order-by="id asc"
419      * @hibernate.collection-key column="issue_id"
420      * @hibernate.collection-one-to-many class="com.panogenesis.model.IssueHistory"
421 	 */
422 	public Set getHistories() {
423 		return histories;
424 	}
425 	/***
426 	 * @param histories The histories to set.
427 	 */
428 	public void setHistories(Set histories) {
429 		this.histories = histories;
430 	}	
431     /***
432      * Adds a component to the project
433      *
434      * @param component
435      */
436     public void addHistory(IssueHistory issueHistory) {
437         getHistories().add(issueHistory);
438     }	
439 	/***
440 	 * @return Returns the project.
441 	 */
442 	public Project getProject() {
443 		return project;
444 	}
445 	/***
446 	 * @param project The project to set.
447 	 */
448 	public void setProject(Project project) {
449 		this.project = project;
450 	}
451 }