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.quadrige3.core.dao.referential;
7
8 /*-
9 * #%L
10 * Quadrige3 Core :: Client API
11 * %%
12 * Copyright (C) 2017 - 2024 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 import java.io.Serializable;
29 import java.sql.Timestamp;
30 import java.util.Date;
31
32 /**
33 * Liste les engins de prélèvement (au sens marque/modèle et non numéro de série).
34 */
35 // HibernateEntity.vsl annotations merge-point
36 public abstract class SamplingEquipment
37 implements Serializable, Comparable<SamplingEquipment>
38 {
39 /**
40 * The serial version UID of this class. Needed for serialization.
41 */
42 private static final long serialVersionUID = -2851108590892064338L;
43
44 // Generate 7 attributes
45 private Integer samplingEquipmentId;
46
47 /**
48 * Identifiant de l'engin
49 * @return this.samplingEquipmentId Integer
50 */
51 public Integer getSamplingEquipmentId()
52 {
53 return this.samplingEquipmentId;
54 }
55
56 /**
57 * Identifiant de l'engin
58 * @param samplingEquipmentIdIn Integer
59 */
60 public void setSamplingEquipmentId(Integer samplingEquipmentIdIn)
61 {
62 this.samplingEquipmentId = samplingEquipmentIdIn;
63 }
64
65 private String samplingEquipmentNm;
66
67 /**
68 * Libellé de l'engin de prélèvement
69 * @return this.samplingEquipmentNm String
70 */
71 public String getSamplingEquipmentNm()
72 {
73 return this.samplingEquipmentNm;
74 }
75
76 /**
77 * Libellé de l'engin de prélèvement
78 * @param samplingEquipmentNmIn String
79 */
80 public void setSamplingEquipmentNm(String samplingEquipmentNmIn)
81 {
82 this.samplingEquipmentNm = samplingEquipmentNmIn;
83 }
84
85 private String samplingEquipmentDc;
86
87 /**
88 * Description de l'engin
89 * @return this.samplingEquipmentDc String
90 */
91 public String getSamplingEquipmentDc()
92 {
93 return this.samplingEquipmentDc;
94 }
95
96 /**
97 * Description de l'engin
98 * @param samplingEquipmentDcIn String
99 */
100 public void setSamplingEquipmentDc(String samplingEquipmentDcIn)
101 {
102 this.samplingEquipmentDc = samplingEquipmentDcIn;
103 }
104
105 private Float samplingEquipmentSize;
106
107 /**
108 * Taille de l'engin
109 * @return this.samplingEquipmentSize Float
110 */
111 public Float getSamplingEquipmentSize()
112 {
113 return this.samplingEquipmentSize;
114 }
115
116 /**
117 * Taille de l'engin
118 * @param samplingEquipmentSizeIn Float
119 */
120 public void setSamplingEquipmentSize(Float samplingEquipmentSizeIn)
121 {
122 this.samplingEquipmentSize = samplingEquipmentSizeIn;
123 }
124
125 private Timestamp updateDt;
126
127 /**
128 * Date de modification de l'objet, mise à jour par le système
129 * @return this.updateDt Timestamp
130 */
131 public Timestamp getUpdateDt()
132 {
133 return this.updateDt;
134 }
135
136 /**
137 * Date de modification de l'objet, mise à jour par le système
138 * @param updateDtIn Timestamp
139 */
140 public void setUpdateDt(Timestamp updateDtIn)
141 {
142 this.updateDt = updateDtIn;
143 }
144
145 private String samplingEquipmentCm;
146
147 /**
148 *
149 * @return this.samplingEquipmentCm String
150 */
151 public String getSamplingEquipmentCm()
152 {
153 return this.samplingEquipmentCm;
154 }
155
156 /**
157 *
158 * @param samplingEquipmentCmIn String
159 */
160 public void setSamplingEquipmentCm(String samplingEquipmentCmIn)
161 {
162 this.samplingEquipmentCm = samplingEquipmentCmIn;
163 }
164
165 private Date creationDt;
166
167 /**
168 *
169 * @return this.creationDt Date
170 */
171 public Date getCreationDt()
172 {
173 return this.creationDt;
174 }
175
176 /**
177 *
178 * @param creationDtIn Date
179 */
180 public void setCreationDt(Date creationDtIn)
181 {
182 this.creationDt = creationDtIn;
183 }
184
185 // Generate 3 associations
186 private Status status;
187
188 /**
189 * Liste des états possibles d'un objet.
190 * @return this.status Status
191 */
192 public Status getStatus()
193 {
194 return this.status;
195 }
196
197 /**
198 * Liste des états possibles d'un objet.
199 * @param statusIn Status
200 */
201 public void setStatus(Status statusIn)
202 {
203 this.status = statusIn;
204 }
205
206 private Unit unitId;
207
208 /**
209 * Liste l'ensemble des unités de mesure.
210 * @return this.unitId Unit
211 */
212 public Unit getUnitId()
213 {
214 return this.unitId;
215 }
216
217 /**
218 * Liste l'ensemble des unités de mesure.
219 * @param unitIdIn Unit
220 */
221 public void setUnitId(Unit unitIdIn)
222 {
223 this.unitId = unitIdIn;
224 }
225
226 /**
227 * Returns <code>true</code> if the argument is an SamplingEquipment instance and all identifiers for this entity
228 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
229 */
230 @Override
231 public boolean equals(Object object)
232 {
233 if (this == object)
234 {
235 return true;
236 }
237 if (!(object instanceof SamplingEquipment))
238 {
239 return false;
240 }
241 final SamplingEquipment that = (SamplingEquipment)object;
242 if (this.samplingEquipmentId == null || that.getSamplingEquipmentId() == null || !this.samplingEquipmentId.equals(that.getSamplingEquipmentId()))
243 {
244 return false;
245 }
246 return true;
247 }
248
249 /**
250 * Returns a hash code based on this entity's identifiers.
251 */
252 @Override
253 public int hashCode()
254 {
255 int hashCode = 0;
256 hashCode = 29 * hashCode + (this.samplingEquipmentId == null ? 0 : this.samplingEquipmentId.hashCode());
257
258 return hashCode;
259 }
260
261 /**
262 * Constructs new instances of {@link SamplingEquipment}.
263 */
264 public static final class Factory
265 {
266 /**
267 * Constructs a new instance of {@link SamplingEquipment}.
268 * @return new SamplingEquipmentImpl()
269 */
270 public static SamplingEquipment newInstance()
271 {
272 return new SamplingEquipmentImpl();
273 }
274
275 /**
276 * Constructs a new instance of {@link SamplingEquipment}, taking all required and/or
277 * read-only properties as arguments, except for identifiers.
278 * @param samplingEquipmentNm String
279 * @param status Status
280 * @return newInstance
281 */
282 public static SamplingEquipment newInstance(String samplingEquipmentNm, Status status)
283 {
284 final SamplingEquipment entity = new SamplingEquipmentImpl();
285 entity.setSamplingEquipmentNm(samplingEquipmentNm);
286 entity.setStatus(status);
287 return entity;
288 }
289
290 /**
291 * Constructs a new instance of {@link SamplingEquipment}, taking all possible properties
292 * (except the identifier(s))as arguments.
293 * @param samplingEquipmentNm String
294 * @param samplingEquipmentDc String
295 * @param samplingEquipmentSize Float
296 * @param updateDt Timestamp
297 * @param samplingEquipmentCm String
298 * @param creationDt Date
299 * @param status Status
300 * @param unitId Unit
301 * @return newInstance SamplingEquipment
302 */
303 public static SamplingEquipment newInstance(String samplingEquipmentNm, String samplingEquipmentDc, Float samplingEquipmentSize, Timestamp updateDt, String samplingEquipmentCm, Date creationDt, Status status, Unit unitId)
304 {
305 final SamplingEquipment entity = new SamplingEquipmentImpl();
306 entity.setSamplingEquipmentNm(samplingEquipmentNm);
307 entity.setSamplingEquipmentDc(samplingEquipmentDc);
308 entity.setSamplingEquipmentSize(samplingEquipmentSize);
309 entity.setUpdateDt(updateDt);
310 entity.setSamplingEquipmentCm(samplingEquipmentCm);
311 entity.setCreationDt(creationDt);
312 entity.setStatus(status);
313 entity.setUnitId(unitId);
314 return entity;
315 }
316 }
317
318 /**
319 * @see Comparable#compareTo
320 */
321 public int compareTo(SamplingEquipment o)
322 {
323 int cmp = 0;
324 if (this.getSamplingEquipmentId() != null)
325 {
326 cmp = this.getSamplingEquipmentId().compareTo(o.getSamplingEquipmentId());
327 }
328 else
329 {
330 if (this.getSamplingEquipmentNm() != null)
331 {
332 cmp = (cmp != 0 ? cmp : this.getSamplingEquipmentNm().compareTo(o.getSamplingEquipmentNm()));
333 }
334 if (this.getSamplingEquipmentDc() != null)
335 {
336 cmp = (cmp != 0 ? cmp : this.getSamplingEquipmentDc().compareTo(o.getSamplingEquipmentDc()));
337 }
338 if (this.getSamplingEquipmentSize() != null)
339 {
340 cmp = (cmp != 0 ? cmp : this.getSamplingEquipmentSize().compareTo(o.getSamplingEquipmentSize()));
341 }
342 if (this.getUpdateDt() != null)
343 {
344 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
345 }
346 if (this.getSamplingEquipmentCm() != null)
347 {
348 cmp = (cmp != 0 ? cmp : this.getSamplingEquipmentCm().compareTo(o.getSamplingEquipmentCm()));
349 }
350 if (this.getCreationDt() != null)
351 {
352 cmp = (cmp != 0 ? cmp : this.getCreationDt().compareTo(o.getCreationDt()));
353 }
354 }
355 return cmp;
356 }
357 // HibernateEntity.vsl merge-point
358 // SamplingEquipment.java merge-point
359 }