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