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   * 
21   *@hibernate.class table="project_version"  
22   */
23  public class ProjectVersion extends BaseObject implements Serializable {
24  
25  	private Integer id;
26  	private Integer major;
27  	private Integer minor;
28  	private String version_number;
29  	private String description;
30  	private Integer status;
31      /*** The value of the simple createDate property. */
32      private Date createDate;
33      /*** The value of the simple lastModified property. */
34      private Date lastModified;
35      private Integer projectId;
36      private String full_version;
37  
38  	/***
39  	 * 
40  	 */
41  	public ProjectVersion() {
42  		super();
43  		// TODO Auto-generated constructor stub
44  	}
45  	
46  	/***
47  	 * @return Returns the id.
48  	 * @hibernate.id column="id"
49       *  generator-class="increment" unsaved-value="null"
50  	 */
51  	public Integer getId() {
52  		return id;
53  	}
54  	/***
55  	 * @param id The id to set.
56  	 */
57  	public void setId(Integer id) {
58  		this.id = id;
59  	}	
60  	
61  	/***
62  	 * @return Returns the version_number.
63  	 * 
64  	 * @hibernate.property column="version_number" not-null="true" length="50"
65  	 * 
66  	 */
67  	public String getVersion_number() {
68  		return version_number;
69  	}
70  	/***
71  	 * @param version_number The version_number to set.
72  	 * 
73  	 * @spring.validator type="required"
74  	 */
75  	public void setVersion_number(String version_number) {
76  		this.version_number = version_number;
77  	}
78  	
79  	/***
80  	 * @return Returns the description.
81  	 * 
82  	 * @hibernate.property column="description" not-null="true" length="255"
83  	 */
84  	public String getDescription() {
85  		return description;
86  	}
87  	/***
88  	 * @param description The description to set.
89  	 * @spring.validator type="required"
90  	 */
91  	public void setDescription(String description) {
92  		this.description = description;
93  	}
94  	
95  	/***
96  	 * @return Returns the major.
97  	 * 
98  	 * @hibernate.property column="major"
99  	 */
100 	public Integer getMajor() {
101 		return major;
102 	}
103 	/***
104 	 * @param major The major to set.
105 	 */
106 	public void setMajor(Integer major) {
107 		this.major = major;
108 	}
109 	/***
110 	 * @return Returns the minor.
111 	 * @hibernate.property column="minor"
112 	 */
113 	public Integer getMinor() {
114 		return minor;
115 	}
116 	/***
117 	 * @param minor The minor to set.
118 	 */
119 	public void setMinor(Integer minor) {
120 		this.minor = minor;
121 	}	
122 	/***
123 	 * @return Returns the full_version.
124 	 */
125 	public String getFull_version() {
126 		String fullVersion = this.version_number;
127 		if (this.major != null){
128 			fullVersion = fullVersion +"." + this.major;
129 		}
130 		if (this.minor != null){
131 			fullVersion = fullVersion +"." + this.minor;
132 		}		
133 		
134 		return fullVersion;
135 	}	
136 	
137 	/***
138 	 * @return Returns the createDate.
139 	 * 
140 	 * @hibernate.property column="create_date"
141 	 */
142 	public Date getCreateDate() {
143 		return createDate;
144 	}
145 	/***
146 	 * @param createDate The createDate to set.
147 	 */
148 	public void setCreateDate(Date createDate) {
149 		this.createDate = createDate;
150 	}
151 
152 	/***
153 	 * @return Returns the lastModified.
154 	 * 
155 	 * @hibernate.property column="last_modified"
156 	 */
157 	public Date getLastModified() {
158 		return lastModified;
159 	}
160 	/***
161 	 * @param lastModified The lastModified to set.
162 	 */
163 	public void setLastModified(Date lastModified) {
164 		this.lastModified = lastModified;
165 	}
166 	/***
167 	 * @return Returns the status.
168 	 * 
169 	 * @hibernate.property column="status"
170 	 */
171 	public Integer getStatus() {
172 		return status;
173 	}
174 	/***
175 	 * @param status The status to set.
176 	 */
177 	public void setStatus(Integer status) {
178 		this.status = status;
179 	}
180 	/***
181 	 * @return Returns the projectId.
182 	 * 
183 	 * @hibernate.property column="project_id"
184 	 */
185 	public Integer getProjectId() {
186 		return projectId;
187 	}
188 	/***
189 	 * @param projectId The projectId to set.
190 	 */
191 	public void setProjectId(Integer projectId) {
192 		this.projectId = projectId;
193 	}
194 	/***
195 	 * @see java.lang.Object#equals(Object)
196 	 */
197 	public boolean equals(Object object) {
198 		if (!(object instanceof ProjectVersion)) {
199 			return false;
200 		}
201 		ProjectVersion rhs = (ProjectVersion) object;
202 		return new EqualsBuilder().append(
203 				this.minor, rhs.minor).append(this.major, rhs.major).append(
204 				this.projectId, rhs.projectId).append(this.description,
205 				rhs.description).append(this.lastModified, rhs.lastModified)
206 				.append(this.version_number, rhs.version_number).append(
207 						this.createDate, rhs.createDate).append(this.status,
208 						rhs.status).append(this.id, rhs.id).isEquals();
209 	}
210 	/***
211 	 * @see java.lang.Object#hashCode()
212 	 */
213 	public int hashCode() {
214 		return new HashCodeBuilder(326922971, -694492023).append(this.minor).append(this.major).append(
215 				this.projectId).append(this.description).append(
216 				this.lastModified).append(this.version_number).append(
217 				this.createDate).append(this.status).append(this.id)
218 				.toHashCode();
219 	}
220 	/***
221 	 * @see java.lang.Object#toString()
222 	 */
223 	public String toString() {
224 		return new ToStringBuilder(this)
225 				.append("description", this.description).append("id", this.id)
226 				.append("major", this.major).append("status", this.status)
227 				.append("minor", this.minor).append("lastModified",
228 						this.lastModified).append("projectId", this.projectId)
229 				.append("version_number", this.version_number).append(
230 						"createDate", this.createDate).toString();
231 	}
232 
233 }