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