View Javadoc

1   /*
2    * Created on Nov 28, 2004
3    *
4    * TODO To change the template for this generated file go to
5    * Window - Preferences - Java - Code Style - Code Templates
6    */
7   package com.panogenesis.model;
8   
9   import java.io.Serializable;
10  import java.util.Date;
11  
12  import org.apache.commons.lang.builder.EqualsBuilder;
13  import org.apache.commons.lang.builder.HashCodeBuilder;
14  import org.apache.commons.lang.builder.ToStringBuilder;
15  /***
16   * @author John Arthur
17   *
18   * TODO To change the template for this generated type comment go to
19   * Window - Preferences - Java - Code Style - Code Templates
20   * @hibernate.class table="project_component"
21   */
22  public class Component extends BaseObject implements Serializable {
23  	private Integer id;
24  	private String componentName;
25  	private String componentDescription;
26  	private Integer componentStatus;
27  	private Date dateCreated;
28  	private Date lastModified;
29  	private Integer projectId;
30  	private Integer listOrder;
31  
32  	/***
33  	 * 
34  	 */
35  	public Component() {}
36  
37  	
38  	/***
39  	 * @return Returns the id.
40  	 * @hibernate.id column="id"
41       *  generator-class="increment" unsaved-value="null"
42  	 */
43  	public Integer getId() {
44  		return id;
45  	}
46  	/***
47  	 * @param id The id to set.
48  	 */
49  	public void setId(Integer id) {
50  		this.id = id;
51  	}
52  	/***
53  	 * @return Returns the componentName.
54  	 * @hibernate.property column="component_name" not-null="true" length="50"
55  	 */
56  	public String getComponentName() {
57  		return componentName;
58  	}
59  	/***
60  	 * @param componentName The componentName to set.
61  	 * 
62  	 * @spring.validator type="required"
63  	 */
64  	public void setComponentName(String componentName) {
65  		this.componentName = componentName;
66  	}
67  	
68  	/***
69  	 * @return Returns the componentDescription.
70  	 * @hibernate.property column="component_description" not-null="true" length="255"
71  	 *
72  	 */
73  	public String getComponentDescription() {
74  		return componentDescription;
75  	}
76  	/***
77  	 * @param componentDescription The componentDescription to set.
78  	 * 
79  	 * @spring.validator type="required"
80  	 */
81  	public void setComponentDescription(String componentDescription) {
82  		this.componentDescription = componentDescription;
83  	}
84  
85  	/***
86  	 * @return Returns the componentStatus.
87  	 * @hibernate.property column="component_status" 
88  	 */
89  	public Integer getComponentStatus() {
90  		return componentStatus;
91  	}
92  	/***
93  	 * @param componentStatus The componentStatus to set.
94  	 */
95  	public void setComponentStatus(Integer componentStatus) {
96  		this.componentStatus = componentStatus;
97  	}
98  	/***
99  	 * @return Returns the dateCreated.
100 	 * @hibernate.property column="date_created" 
101 	 */
102 	public Date getDateCreated() {
103 		return dateCreated;
104 	}
105 	/***
106 	 * @param dateCreated The dateCreated to set.
107 	 */
108 	public void setDateCreated(Date dateCreated) {
109 		this.dateCreated = dateCreated;
110 	}
111 
112 	/***
113 	 * @return Returns the lastModified.
114 	 * @hibernate.property column="last_modified" 
115 	 */
116 	public Date getLastModified() {
117 		return lastModified;
118 	}
119 	/***
120 	 * @param lastModified The lastModified to set.
121 	 */
122 	public void setLastModified(Date lastModified) {
123 		this.lastModified = lastModified;
124 	}
125 	/***
126 	 * @return Returns the listOrder.
127 	 * @hibernate.property column="list_order" 
128 	 */
129 	public Integer getListOrder() {
130 		return listOrder;
131 	}
132 	/***
133 	 * @param listOrder The listOrder to set.
134 	 */
135 	public void setListOrder(Integer listOrder) {
136 		this.listOrder = listOrder;
137 	}
138 	/***
139 	 * @return Returns the project_id.
140 	 * 
141 	 * @hibernate.property column="project_id" 
142 	 * hibernate.many-to-one cascade="all"
143 	 * 						  column="project_id" 
144 	 *                        class="com.panogenesis.model.Project"
145 	 *                    
146 	 */
147 
148 	public Integer getProjectId() {
149 		return projectId;
150 	}
151 	/***
152 	 * @param project_id The project_id to set.
153 	 */
154 	public void setProjectId(Integer projectId) {
155 		this.projectId = projectId;
156 	}
157 	
158 	
159 	/***
160 	 * @see java.lang.Object#equals(Object)
161 	 */
162 	public boolean equals(Object object) {
163 		if (!(object instanceof Component)) {
164 			return false;
165 		}
166 		Component rhs = (Component) object;
167 		return new EqualsBuilder().append(
168 				this.listOrder, rhs.listOrder).append(this.componentName,
169 				rhs.componentName).append(this.componentDescription,
170 				rhs.componentDescription).append(this.lastModified,
171 				rhs.lastModified).append(this.projectId, rhs.projectId)
172 				.append(this.dateCreated, rhs.dateCreated).append(this.id,
173 						rhs.id).append(this.componentStatus,
174 						rhs.componentStatus).isEquals();
175 	}
176 	/***
177 	 * @see java.lang.Object#hashCode()
178 	 */
179 	public int hashCode() {
180 		return new HashCodeBuilder(-256210987, 1714275911).append(this.listOrder).append(
181 				this.componentName).append(this.componentDescription).append(
182 				this.lastModified).append(this.projectId).append(
183 				this.dateCreated).append(this.id).append(this.componentStatus)
184 				.toHashCode();
185 	}
186 	/***
187 	 * @see java.lang.Object#toString()
188 	 */
189 	public String toString() {
190 		return new ToStringBuilder(this).append("componentName",
191 				this.componentName).append("id", this.id).append("listOrder",
192 				this.listOrder).append("project_id", this.projectId).append(
193 				"lastModified", this.lastModified).append(
194 				"componentDescription", this.componentDescription).append(
195 				"componentStatus", this.componentStatus).append("dateCreated",
196 				this.dateCreated).toString();
197 	}
198 }