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.data.survey;
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 fr.ifremer.quadrige3.core.dao.administration.user.Department;
29 import fr.ifremer.quadrige3.core.dao.referential.QualityFlag;
30 import fr.ifremer.quadrige3.core.dao.referential.eunis.EunisTypology;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33 import java.util.Date;
34
35 /**
36 * Commentaire sur l'habitat observé.
37 */
38 // HibernateEntity.vsl annotations merge-point
39 public abstract class ObservedHabitat
40 implements Serializable, Comparable<ObservedHabitat>
41 {
42 /**
43 * The serial version UID of this class. Needed for serialization.
44 */
45 private static final long serialVersionUID = -1072241682098508233L;
46
47 // Generate 7 attributes
48 private String observHabCm;
49
50 /**
51 * Commentaire sur l'habitat observé
52 * @return this.observHabCm String
53 */
54 public String getObservHabCm()
55 {
56 return this.observHabCm;
57 }
58
59 /**
60 * Commentaire sur l'habitat observé
61 * @param observHabCmIn String
62 */
63 public void setObservHabCm(String observHabCmIn)
64 {
65 this.observHabCm = observHabCmIn;
66 }
67
68 private Date observHabValidDt;
69
70 /**
71 * Date de validation de la données
72 * @return this.observHabValidDt Date
73 */
74 public Date getObservHabValidDt()
75 {
76 return this.observHabValidDt;
77 }
78
79 /**
80 * Date de validation de la données
81 * @param observHabValidDtIn Date
82 */
83 public void setObservHabValidDt(Date observHabValidDtIn)
84 {
85 this.observHabValidDt = observHabValidDtIn;
86 }
87
88 private Date observHabQualifDt;
89
90 /**
91 * Date de qualification de la données
92 * @return this.observHabQualifDt Date
93 */
94 public Date getObservHabQualifDt()
95 {
96 return this.observHabQualifDt;
97 }
98
99 /**
100 * Date de qualification de la données
101 * @param observHabQualifDtIn Date
102 */
103 public void setObservHabQualifDt(Date observHabQualifDtIn)
104 {
105 this.observHabQualifDt = observHabQualifDtIn;
106 }
107
108 private String observHabQualifCm;
109
110 /**
111 * Commentaire sur la qualification du passage
112 * D'une façon générale, il faut vérifier que les données de controle, qualification et
113 * validation, dates ou commentaires sont bien du ressort de la classe courante et ne doivent
114 * pas être gérées dans une super classe de type métadonnées, et plus particulièrement dans ce
115 * cas avec les données géométriques et la norme ISO 19115.
116 * @return this.observHabQualifCm String
117 */
118 public String getObservHabQualifCm()
119 {
120 return this.observHabQualifCm;
121 }
122
123 /**
124 * Commentaire sur la qualification du passage
125 * D'une façon générale, il faut vérifier que les données de controle, qualification et
126 * validation, dates ou commentaires sont bien du ressort de la classe courante et ne doivent
127 * pas être gérées dans une super classe de type métadonnées, et plus particulièrement dans ce
128 * cas avec les données géométriques et la norme ISO 19115.
129 * @param observHabQualifCmIn String
130 */
131 public void setObservHabQualifCm(String observHabQualifCmIn)
132 {
133 this.observHabQualifCm = observHabQualifCmIn;
134 }
135
136 private Timestamp updateDt;
137
138 /**
139 * Date de modification de l'objet, mise à jour par le système
140 * @return this.updateDt Timestamp
141 */
142 public Timestamp getUpdateDt()
143 {
144 return this.updateDt;
145 }
146
147 /**
148 * Date de modification de l'objet, mise à jour par le système
149 * @param updateDtIn Timestamp
150 */
151 public void setUpdateDt(Timestamp updateDtIn)
152 {
153 this.updateDt = updateDtIn;
154 }
155
156 private Integer observedHabitatId;
157
158 /**
159 *
160 * @return this.observedHabitatId Integer
161 */
162 public Integer getObservedHabitatId()
163 {
164 return this.observedHabitatId;
165 }
166
167 /**
168 *
169 * @param observedHabitatIdIn Integer
170 */
171 public void setObservedHabitatId(Integer observedHabitatIdIn)
172 {
173 this.observedHabitatId = observedHabitatIdIn;
174 }
175
176 private Integer remoteId;
177
178 /**
179 *
180 * @return this.remoteId Integer
181 */
182 public Integer getRemoteId()
183 {
184 return this.remoteId;
185 }
186
187 /**
188 *
189 * @param remoteIdIn Integer
190 */
191 public void setRemoteId(Integer remoteIdIn)
192 {
193 this.remoteId = remoteIdIn;
194 }
195
196 // Generate 4 associations
197 private QualityFlag qualityFlag;
198
199 /**
200 * Liste des niveaux de qualification.
201 * @return this.qualityFlag QualityFlag
202 */
203 public QualityFlag getQualityFlag()
204 {
205 return this.qualityFlag;
206 }
207
208 /**
209 * Liste des niveaux de qualification.
210 * @param qualityFlagIn QualityFlag
211 */
212 public void setQualityFlag(QualityFlag qualityFlagIn)
213 {
214 this.qualityFlag = qualityFlagIn;
215 }
216
217 private EunisTypology eunisTypology;
218
219 /**
220 * Typologie EUNIS
221 * @return this.eunisTypology EunisTypology
222 */
223 public EunisTypology getEunisTypology()
224 {
225 return this.eunisTypology;
226 }
227
228 /**
229 * Typologie EUNIS
230 * @param eunisTypologyIn EunisTypology
231 */
232 public void setEunisTypology(EunisTypology eunisTypologyIn)
233 {
234 this.eunisTypology = eunisTypologyIn;
235 }
236
237 private Department recorderDepartment;
238
239 /**
240 * Liste les départements ou services auxquels sont rattachés les agents
241 * @return this.recorderDepartment Department
242 */
243 public Department getRecorderDepartment()
244 {
245 return this.recorderDepartment;
246 }
247
248 /**
249 * Liste les départements ou services auxquels sont rattachés les agents
250 * @param recorderDepartmentIn Department
251 */
252 public void setRecorderDepartment(Department recorderDepartmentIn)
253 {
254 this.recorderDepartment = recorderDepartmentIn;
255 }
256
257 private Survey survey;
258
259 /**
260 * Liste les différents passages effectués sur un lieu de surveillance.
261 * Liste les différents passages effectués sur un lieu de surveillance.
262 * @return this.survey Survey
263 */
264 public Survey getSurvey()
265 {
266 return this.survey;
267 }
268
269 /**
270 * Liste les différents passages effectués sur un lieu de surveillance.
271 * Liste les différents passages effectués sur un lieu de surveillance.
272 * @param surveyIn Survey
273 */
274 public void setSurvey(Survey surveyIn)
275 {
276 this.survey = surveyIn;
277 }
278
279 /**
280 * Returns <code>true</code> if the argument is an ObservedHabitat instance and all identifiers for this entity
281 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
282 */
283 @Override
284 public boolean equals(Object object)
285 {
286 if (this == object)
287 {
288 return true;
289 }
290 if (!(object instanceof ObservedHabitat))
291 {
292 return false;
293 }
294 final ObservedHabitat that = (ObservedHabitat)object;
295 if (this.observedHabitatId == null || that.getObservedHabitatId() == null || !this.observedHabitatId.equals(that.getObservedHabitatId()))
296 {
297 return false;
298 }
299 return true;
300 }
301
302 /**
303 * Returns a hash code based on this entity's identifiers.
304 */
305 @Override
306 public int hashCode()
307 {
308 int hashCode = 0;
309 hashCode = 29 * hashCode + (this.observedHabitatId == null ? 0 : this.observedHabitatId.hashCode());
310
311 return hashCode;
312 }
313
314 /**
315 * Constructs new instances of {@link ObservedHabitat}.
316 */
317 public static final class Factory
318 {
319 /**
320 * Constructs a new instance of {@link ObservedHabitat}.
321 * @return new ObservedHabitatImpl()
322 */
323 public static ObservedHabitat newInstance()
324 {
325 return new ObservedHabitatImpl();
326 }
327
328 /**
329 * Constructs a new instance of {@link ObservedHabitat}, taking all required and/or
330 * read-only properties as arguments, except for identifiers.
331 * @param qualityFlag QualityFlag
332 * @param eunisTypology EunisTypology
333 * @param survey Survey
334 * @return newInstance
335 */
336 public static ObservedHabitat newInstance(QualityFlag qualityFlag, EunisTypology eunisTypology, Survey survey)
337 {
338 final ObservedHabitat entity = new ObservedHabitatImpl();
339 entity.setQualityFlag(qualityFlag);
340 entity.setEunisTypology(eunisTypology);
341 entity.setSurvey(survey);
342 return entity;
343 }
344
345 /**
346 * Constructs a new instance of {@link ObservedHabitat}, taking all possible properties
347 * (except the identifier(s))as arguments.
348 * @param observHabCm String
349 * @param observHabValidDt Date
350 * @param observHabQualifDt Date
351 * @param observHabQualifCm String
352 * @param updateDt Timestamp
353 * @param remoteId Integer
354 * @param qualityFlag QualityFlag
355 * @param eunisTypology EunisTypology
356 * @param recorderDepartment Department
357 * @param survey Survey
358 * @return newInstance ObservedHabitat
359 */
360 public static ObservedHabitat newInstance(String observHabCm, Date observHabValidDt, Date observHabQualifDt, String observHabQualifCm, Timestamp updateDt, Integer remoteId, QualityFlag qualityFlag, EunisTypology eunisTypology, Department recorderDepartment, Survey survey)
361 {
362 final ObservedHabitat entity = new ObservedHabitatImpl();
363 entity.setObservHabCm(observHabCm);
364 entity.setObservHabValidDt(observHabValidDt);
365 entity.setObservHabQualifDt(observHabQualifDt);
366 entity.setObservHabQualifCm(observHabQualifCm);
367 entity.setUpdateDt(updateDt);
368 entity.setRemoteId(remoteId);
369 entity.setQualityFlag(qualityFlag);
370 entity.setEunisTypology(eunisTypology);
371 entity.setRecorderDepartment(recorderDepartment);
372 entity.setSurvey(survey);
373 return entity;
374 }
375 }
376
377 /**
378 * @see Comparable#compareTo
379 */
380 public int compareTo(ObservedHabitat o)
381 {
382 int cmp = 0;
383 if (this.getObservedHabitatId() != null)
384 {
385 cmp = this.getObservedHabitatId().compareTo(o.getObservedHabitatId());
386 }
387 else
388 {
389 if (this.getObservHabCm() != null)
390 {
391 cmp = (cmp != 0 ? cmp : this.getObservHabCm().compareTo(o.getObservHabCm()));
392 }
393 if (this.getObservHabValidDt() != null)
394 {
395 cmp = (cmp != 0 ? cmp : this.getObservHabValidDt().compareTo(o.getObservHabValidDt()));
396 }
397 if (this.getObservHabQualifDt() != null)
398 {
399 cmp = (cmp != 0 ? cmp : this.getObservHabQualifDt().compareTo(o.getObservHabQualifDt()));
400 }
401 if (this.getObservHabQualifCm() != null)
402 {
403 cmp = (cmp != 0 ? cmp : this.getObservHabQualifCm().compareTo(o.getObservHabQualifCm()));
404 }
405 if (this.getUpdateDt() != null)
406 {
407 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
408 }
409 if (this.getRemoteId() != null)
410 {
411 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
412 }
413 }
414 return cmp;
415 }
416 // HibernateEntity.vsl merge-point
417 // ObservedHabitat.java merge-point
418 }