1 // license-header java merge-point
2 //
3 // Attention: Generated code! Do not modify by hand!
4 // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
5 //
6 package fr.ifremer.quadrige2.core.dao.system;
7
8 /*-
9 * #%L
10 * Quadrige2 Core :: Server API
11 * %%
12 * Copyright (C) 2017 Ifremer
13 * %%
14 * This program is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Affero General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU Affero General Public License
25 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 * #L%
27 */
28
29 import fr.ifremer.quadrige2.core.dao.administration.user.Quser;
30 import fr.ifremer.quadrige2.core.dao.referential.ObjectType;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33
34 /**
35 *
36 */
37 // HibernateEntity.vsl annotations merge-point
38 public abstract class ValidationHistory
39 implements Serializable, Comparable<ValidationHistory>
40 {
41 /**
42 * The serial version UID of this class. Needed for serialization.
43 */
44 private static final long serialVersionUID = 7994627966421239821L;
45
46 // Generate 5 attributes
47 private Integer validHistId;
48
49 /**
50 *
51 * @return this.validHistId Integer
52 */
53 public Integer getValidHistId()
54 {
55 return this.validHistId;
56 }
57
58 /**
59 *
60 * @param validHistIdIn Integer
61 */
62 public void setValidHistId(Integer validHistIdIn)
63 {
64 this.validHistId = validHistIdIn;
65 }
66
67 private Integer validHistElementId;
68
69 /**
70 *
71 * @return this.validHistElementId Integer
72 */
73 public Integer getValidHistElementId()
74 {
75 return this.validHistElementId;
76 }
77
78 /**
79 *
80 * @param validHistElementIdIn Integer
81 */
82 public void setValidHistElementId(Integer validHistElementIdIn)
83 {
84 this.validHistElementId = validHistElementIdIn;
85 }
86
87 private String validHistOperationCm;
88
89 /**
90 *
91 * @return this.validHistOperationCm String
92 */
93 public String getValidHistOperationCm()
94 {
95 return this.validHistOperationCm;
96 }
97
98 /**
99 *
100 * @param validHistOperationCmIn String
101 */
102 public void setValidHistOperationCm(String validHistOperationCmIn)
103 {
104 this.validHistOperationCm = validHistOperationCmIn;
105 }
106
107 private String validHistPreviousCm;
108
109 /**
110 *
111 * @return this.validHistPreviousCm String
112 */
113 public String getValidHistPreviousCm()
114 {
115 return this.validHistPreviousCm;
116 }
117
118 /**
119 *
120 * @param validHistPreviousCmIn String
121 */
122 public void setValidHistPreviousCm(String validHistPreviousCmIn)
123 {
124 this.validHistPreviousCm = validHistPreviousCmIn;
125 }
126
127 private Timestamp updateDt;
128
129 /**
130 *
131 * @return this.updateDt Timestamp
132 */
133 public Timestamp getUpdateDt()
134 {
135 return this.updateDt;
136 }
137
138 /**
139 *
140 * @param updateDtIn Timestamp
141 */
142 public void setUpdateDt(Timestamp updateDtIn)
143 {
144 this.updateDt = updateDtIn;
145 }
146
147 // Generate 2 associations
148 private ObjectType objectType;
149
150 /**
151 * Liste des types d'objets qui peuvent être associés à la photo ou à un résultat. Cette liste
152 * ne peut
153 * pas être modifiée par l'utilisateur.
154 * @return this.objectType ObjectType
155 */
156 public ObjectType getObjectType()
157 {
158 return this.objectType;
159 }
160
161 /**
162 * Liste des types d'objets qui peuvent être associés à la photo ou à un résultat. Cette liste
163 * ne peut
164 * pas être modifiée par l'utilisateur.
165 * @param objectTypeIn ObjectType
166 */
167 public void setObjectType(ObjectType objectTypeIn)
168 {
169 this.objectType = objectTypeIn;
170 }
171
172 private Quser quser;
173
174 /**
175 * Liste l'ensemble des agents et utilisateurs du système.
176 * @return this.quser Quser
177 */
178 public Quser getQuser()
179 {
180 return this.quser;
181 }
182
183 /**
184 * Liste l'ensemble des agents et utilisateurs du système.
185 * @param quserIn Quser
186 */
187 public void setQuser(Quser quserIn)
188 {
189 this.quser = quserIn;
190 }
191
192 /**
193 * Returns <code>true</code> if the argument is an ValidationHistory instance and all identifiers for this entity
194 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
195 */
196 @Override
197 public boolean equals(Object object)
198 {
199 if (this == object)
200 {
201 return true;
202 }
203 if (!(object instanceof ValidationHistory))
204 {
205 return false;
206 }
207 final ValidationHistory that = (ValidationHistory)object;
208 if (this.validHistId == null || that.getValidHistId() == null || !this.validHistId.equals(that.getValidHistId()))
209 {
210 return false;
211 }
212 return true;
213 }
214
215 /**
216 * Returns a hash code based on this entity's identifiers.
217 */
218 @Override
219 public int hashCode()
220 {
221 int hashCode = 0;
222 hashCode = 29 * hashCode + (this.validHistId == null ? 0 : this.validHistId.hashCode());
223
224 return hashCode;
225 }
226
227 /**
228 * Constructs new instances of {@link ValidationHistory}.
229 */
230 public static final class Factory
231 {
232 /**
233 * Constructs a new instance of {@link ValidationHistory}.
234 * @return new ValidationHistoryImpl()
235 */
236 public static ValidationHistory newInstance()
237 {
238 return new ValidationHistoryImpl();
239 }
240
241 /**
242 * Constructs a new instance of {@link ValidationHistory}, taking all required and/or
243 * read-only properties as arguments, except for identifiers.
244 * @param validHistElementId Integer
245 * @param updateDt Timestamp
246 * @param objectType ObjectType
247 * @param quser Quser
248 * @return newInstance
249 */
250 public static ValidationHistory newInstance(Integer validHistElementId, Timestamp updateDt, ObjectType objectType, Quser quser)
251 {
252 final ValidationHistory entity = new ValidationHistoryImpl();
253 entity.setValidHistElementId(validHistElementId);
254 entity.setUpdateDt(updateDt);
255 entity.setObjectType(objectType);
256 entity.setQuser(quser);
257 return entity;
258 }
259
260 /**
261 * Constructs a new instance of {@link ValidationHistory}, taking all possible properties
262 * (except the identifier(s))as arguments.
263 * @param validHistElementId Integer
264 * @param validHistOperationCm String
265 * @param validHistPreviousCm String
266 * @param updateDt Timestamp
267 * @param objectType ObjectType
268 * @param quser Quser
269 * @return newInstance ValidationHistory
270 */
271 public static ValidationHistory newInstance(Integer validHistElementId, String validHistOperationCm, String validHistPreviousCm, Timestamp updateDt, ObjectType objectType, Quser quser)
272 {
273 final ValidationHistory entity = new ValidationHistoryImpl();
274 entity.setValidHistElementId(validHistElementId);
275 entity.setValidHistOperationCm(validHistOperationCm);
276 entity.setValidHistPreviousCm(validHistPreviousCm);
277 entity.setUpdateDt(updateDt);
278 entity.setObjectType(objectType);
279 entity.setQuser(quser);
280 return entity;
281 }
282 }
283
284 /**
285 * @see Comparable#compareTo
286 */
287 public int compareTo(ValidationHistory o)
288 {
289 int cmp = 0;
290 if (this.getValidHistId() != null)
291 {
292 cmp = this.getValidHistId().compareTo(o.getValidHistId());
293 }
294 else
295 {
296 if (this.getValidHistElementId() != null)
297 {
298 cmp = (cmp != 0 ? cmp : this.getValidHistElementId().compareTo(o.getValidHistElementId()));
299 }
300 if (this.getValidHistOperationCm() != null)
301 {
302 cmp = (cmp != 0 ? cmp : this.getValidHistOperationCm().compareTo(o.getValidHistOperationCm()));
303 }
304 if (this.getValidHistPreviousCm() != null)
305 {
306 cmp = (cmp != 0 ? cmp : this.getValidHistPreviousCm().compareTo(o.getValidHistPreviousCm()));
307 }
308 if (this.getUpdateDt() != null)
309 {
310 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
311 }
312 }
313 return cmp;
314 }
315 // HibernateEntity.vsl merge-point
316 // ValidationHistory.java merge-point
317 }