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