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.photo;
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.data.sample.Sample;
30 import fr.ifremer.quadrige3.core.dao.data.samplingoperation.SamplingOperation;
31 import fr.ifremer.quadrige3.core.dao.data.survey.Survey;
32 import fr.ifremer.quadrige3.core.dao.referential.ObjectType;
33 import fr.ifremer.quadrige3.core.dao.referential.PhotoType;
34 import fr.ifremer.quadrige3.core.dao.referential.QualityFlag;
35 import java.io.Serializable;
36 import java.sql.Timestamp;
37 import java.util.Date;
38
39 /**
40 * Liste les photos illustrant les passages, prélèvement, échantillon, taxon, .
41 */
42 // HibernateEntity.vsl annotations merge-point
43 public abstract class Photo
44 implements Serializable, Comparable<Photo>
45 {
46 /**
47 * The serial version UID of this class. Needed for serialization.
48 */
49 private static final long serialVersionUID = -1034938653766129666L;
50
51 // Generate 12 attributes
52 private Integer photoId;
53
54 /**
55 * Identifiant interne de la photo
56 * @return this.photoId Integer
57 */
58 public Integer getPhotoId()
59 {
60 return this.photoId;
61 }
62
63 /**
64 * Identifiant interne de la photo
65 * @param photoIdIn Integer
66 */
67 public void setPhotoId(Integer photoIdIn)
68 {
69 this.photoId = photoIdIn;
70 }
71
72 private Integer objectId;
73
74 /**
75 * Identifiant de l'objet photographié
76 * @return this.objectId Integer
77 */
78 public Integer getObjectId()
79 {
80 return this.objectId;
81 }
82
83 /**
84 * Identifiant de l'objet photographié
85 * @param objectIdIn Integer
86 */
87 public void setObjectId(Integer objectIdIn)
88 {
89 this.objectId = objectIdIn;
90 }
91
92 private String photoNm;
93
94 /**
95 * Libellé de la photo
96 * @return this.photoNm String
97 */
98 public String getPhotoNm()
99 {
100 return this.photoNm;
101 }
102
103 /**
104 * Libellé de la photo
105 * @param photoNmIn String
106 */
107 public void setPhotoNm(String photoNmIn)
108 {
109 this.photoNm = photoNmIn;
110 }
111
112 private String photoDirDc;
113
114 /**
115 * Description de la direction de la photo
116 * @return this.photoDirDc String
117 */
118 public String getPhotoDirDc()
119 {
120 return this.photoDirDc;
121 }
122
123 /**
124 * Description de la direction de la photo
125 * @param photoDirDcIn String
126 */
127 public void setPhotoDirDc(String photoDirDcIn)
128 {
129 this.photoDirDc = photoDirDcIn;
130 }
131
132 private String photoCm;
133
134 /**
135 * Commentaire associé à la photo
136 * @return this.photoCm String
137 */
138 public String getPhotoCm()
139 {
140 return this.photoCm;
141 }
142
143 /**
144 * Commentaire associé à la photo
145 * @param photoCmIn String
146 */
147 public void setPhotoCm(String photoCmIn)
148 {
149 this.photoCm = photoCmIn;
150 }
151
152 private String photoLk;
153
154 /**
155 * Adresse du fichier photo, cette adresse est une adresse relative par rapport à une racine
156 * définie dans l'environnement Quadrige. Cette adresse est renseignée par le système et n'est
157 * pas modifiable par l'utilisateur.
158 * @return this.photoLk String
159 */
160 public String getPhotoLk()
161 {
162 return this.photoLk;
163 }
164
165 /**
166 * Adresse du fichier photo, cette adresse est une adresse relative par rapport à une racine
167 * définie dans l'environnement Quadrige. Cette adresse est renseignée par le système et n'est
168 * pas modifiable par l'utilisateur.
169 * @param photoLkIn String
170 */
171 public void setPhotoLk(String photoLkIn)
172 {
173 this.photoLk = photoLkIn;
174 }
175
176 private Date photoDt;
177
178 /**
179 * Date de prise de la photo optionnel
180 * @return this.photoDt Date
181 */
182 public Date getPhotoDt()
183 {
184 return this.photoDt;
185 }
186
187 /**
188 * Date de prise de la photo optionnel
189 * @param photoDtIn Date
190 */
191 public void setPhotoDt(Date photoDtIn)
192 {
193 this.photoDt = photoDtIn;
194 }
195
196 private Date photoValidDt;
197
198 /**
199 * Date de validation
200 * @return this.photoValidDt Date
201 */
202 public Date getPhotoValidDt()
203 {
204 return this.photoValidDt;
205 }
206
207 /**
208 * Date de validation
209 * @param photoValidDtIn Date
210 */
211 public void setPhotoValidDt(Date photoValidDtIn)
212 {
213 this.photoValidDt = photoValidDtIn;
214 }
215
216 private Date photoQualifDt;
217
218 /**
219 * Date de qualification de la photo
220 * @return this.photoQualifDt Date
221 */
222 public Date getPhotoQualifDt()
223 {
224 return this.photoQualifDt;
225 }
226
227 /**
228 * Date de qualification de la photo
229 * @param photoQualifDtIn Date
230 */
231 public void setPhotoQualifDt(Date photoQualifDtIn)
232 {
233 this.photoQualifDt = photoQualifDtIn;
234 }
235
236 private String photoQualifCm;
237
238 /**
239 * Commentaire sur la qualification de la photo
240 * @return this.photoQualifCm String
241 */
242 public String getPhotoQualifCm()
243 {
244 return this.photoQualifCm;
245 }
246
247 /**
248 * Commentaire sur la qualification de la photo
249 * @param photoQualifCmIn String
250 */
251 public void setPhotoQualifCm(String photoQualifCmIn)
252 {
253 this.photoQualifCm = photoQualifCmIn;
254 }
255
256 private Timestamp updateDt;
257
258 /**
259 * Date de modification de l'objet, mise à jour par le système
260 * @return this.updateDt Timestamp
261 */
262 public Timestamp getUpdateDt()
263 {
264 return this.updateDt;
265 }
266
267 /**
268 * Date de modification de l'objet, mise à jour par le système
269 * @param updateDtIn Timestamp
270 */
271 public void setUpdateDt(Timestamp updateDtIn)
272 {
273 this.updateDt = updateDtIn;
274 }
275
276 private Integer remoteId;
277
278 /**
279 *
280 * @return this.remoteId Integer
281 */
282 public Integer getRemoteId()
283 {
284 return this.remoteId;
285 }
286
287 /**
288 *
289 * @param remoteIdIn Integer
290 */
291 public void setRemoteId(Integer remoteIdIn)
292 {
293 this.remoteId = remoteIdIn;
294 }
295
296 // Generate 7 associations
297 private Sample sample;
298
299 /**
300 * Liste les échantillons prélevés lors d'un passage sur un lieu de surveillance.
301 * @return this.sample Sample
302 */
303 public Sample getSample()
304 {
305 return this.sample;
306 }
307
308 /**
309 * Liste les échantillons prélevés lors d'un passage sur un lieu de surveillance.
310 * @param sampleIn Sample
311 */
312 public void setSample(Sample sampleIn)
313 {
314 this.sample = sampleIn;
315 }
316
317 private PhotoType photoType;
318
319 /**
320 * Liste les types des photo (voir avec niveau saisie).
321 * @return this.photoType PhotoType
322 */
323 public PhotoType getPhotoType()
324 {
325 return this.photoType;
326 }
327
328 /**
329 * Liste les types des photo (voir avec niveau saisie).
330 * @param photoTypeIn PhotoType
331 */
332 public void setPhotoType(PhotoType photoTypeIn)
333 {
334 this.photoType = photoTypeIn;
335 }
336
337 private QualityFlag qualityFlag;
338
339 /**
340 * Liste des niveaux de qualification.
341 * @return this.qualityFlag QualityFlag
342 */
343 public QualityFlag getQualityFlag()
344 {
345 return this.qualityFlag;
346 }
347
348 /**
349 * Liste des niveaux de qualification.
350 * @param qualityFlagIn QualityFlag
351 */
352 public void setQualityFlag(QualityFlag qualityFlagIn)
353 {
354 this.qualityFlag = qualityFlagIn;
355 }
356
357 private ObjectType objectType;
358
359 /**
360 * Liste des types d'objets qui peuvent être associés à la photo ou à un résultat. Cette liste
361 * ne peut
362 * pas être modifiée par l'utilisateur.
363 * @return this.objectType ObjectType
364 */
365 public ObjectType getObjectType()
366 {
367 return this.objectType;
368 }
369
370 /**
371 * Liste des types d'objets qui peuvent être associés à la photo ou à un résultat. Cette liste
372 * ne peut
373 * pas être modifiée par l'utilisateur.
374 * @param objectTypeIn ObjectType
375 */
376 public void setObjectType(ObjectType objectTypeIn)
377 {
378 this.objectType = objectTypeIn;
379 }
380
381 private Department recorderDepartment;
382
383 /**
384 * Liste les départements ou services auxquels sont rattachés les agents
385 * @return this.recorderDepartment Department
386 */
387 public Department getRecorderDepartment()
388 {
389 return this.recorderDepartment;
390 }
391
392 /**
393 * Liste les départements ou services auxquels sont rattachés les agents
394 * @param recorderDepartmentIn Department
395 */
396 public void setRecorderDepartment(Department recorderDepartmentIn)
397 {
398 this.recorderDepartment = recorderDepartmentIn;
399 }
400
401 private Survey survey;
402
403 /**
404 * Liste les différents passages effectués sur un lieu de surveillance.
405 * Liste les différents passages effectués sur un lieu de surveillance.
406 * @return this.survey Survey
407 */
408 public Survey getSurvey()
409 {
410 return this.survey;
411 }
412
413 /**
414 * Liste les différents passages effectués sur un lieu de surveillance.
415 * Liste les différents passages effectués sur un lieu de surveillance.
416 * @param surveyIn Survey
417 */
418 public void setSurvey(Survey surveyIn)
419 {
420 this.survey = surveyIn;
421 }
422
423 private SamplingOperation samplingOperation;
424
425 /**
426 * Liste les prélévements effectués lors d'un passage.
427 * @return this.samplingOperation SamplingOperation
428 */
429 public SamplingOperation getSamplingOperation()
430 {
431 return this.samplingOperation;
432 }
433
434 /**
435 * Liste les prélévements effectués lors d'un passage.
436 * @param samplingOperationIn SamplingOperation
437 */
438 public void setSamplingOperation(SamplingOperation samplingOperationIn)
439 {
440 this.samplingOperation = samplingOperationIn;
441 }
442
443 /**
444 * Returns <code>true</code> if the argument is an Photo instance and all identifiers for this entity
445 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
446 */
447 @Override
448 public boolean equals(Object object)
449 {
450 if (this == object)
451 {
452 return true;
453 }
454 if (!(object instanceof Photo))
455 {
456 return false;
457 }
458 final Photo that = (Photo)object;
459 if (this.photoId == null || that.getPhotoId() == null || !this.photoId.equals(that.getPhotoId()))
460 {
461 return false;
462 }
463 return true;
464 }
465
466 /**
467 * Returns a hash code based on this entity's identifiers.
468 */
469 @Override
470 public int hashCode()
471 {
472 int hashCode = 0;
473 hashCode = 29 * hashCode + (this.photoId == null ? 0 : this.photoId.hashCode());
474
475 return hashCode;
476 }
477
478 /**
479 * Constructs new instances of {@link Photo}.
480 */
481 public static final class Factory
482 {
483 /**
484 * Constructs a new instance of {@link Photo}.
485 * @return new PhotoImpl()
486 */
487 public static Photo newInstance()
488 {
489 return new PhotoImpl();
490 }
491
492 /**
493 * Constructs a new instance of {@link Photo}, taking all required and/or
494 * read-only properties as arguments, except for identifiers.
495 * @param objectId Integer
496 * @param objectType ObjectType
497 * @param recorderDepartment Department
498 * @return newInstance
499 */
500 public static Photo newInstance(Integer objectId, ObjectType objectType, Department recorderDepartment)
501 {
502 final Photo entity = new PhotoImpl();
503 entity.setObjectId(objectId);
504 entity.setObjectType(objectType);
505 entity.setRecorderDepartment(recorderDepartment);
506 return entity;
507 }
508
509 /**
510 * Constructs a new instance of {@link Photo}, taking all possible properties
511 * (except the identifier(s))as arguments.
512 * @param objectId Integer
513 * @param photoNm String
514 * @param photoDirDc String
515 * @param photoCm String
516 * @param photoLk String
517 * @param photoDt Date
518 * @param photoValidDt Date
519 * @param photoQualifDt Date
520 * @param photoQualifCm String
521 * @param updateDt Timestamp
522 * @param remoteId Integer
523 * @param sample Sample
524 * @param photoType PhotoType
525 * @param qualityFlag QualityFlag
526 * @param objectType ObjectType
527 * @param recorderDepartment Department
528 * @param survey Survey
529 * @param samplingOperation SamplingOperation
530 * @return newInstance Photo
531 */
532 public static Photo newInstance(Integer objectId, String photoNm, String photoDirDc, String photoCm, String photoLk, Date photoDt, Date photoValidDt, Date photoQualifDt, String photoQualifCm, Timestamp updateDt, Integer remoteId, Sample sample, PhotoType photoType, QualityFlag qualityFlag, ObjectType objectType, Department recorderDepartment, Survey survey, SamplingOperation samplingOperation)
533 {
534 final Photo entity = new PhotoImpl();
535 entity.setObjectId(objectId);
536 entity.setPhotoNm(photoNm);
537 entity.setPhotoDirDc(photoDirDc);
538 entity.setPhotoCm(photoCm);
539 entity.setPhotoLk(photoLk);
540 entity.setPhotoDt(photoDt);
541 entity.setPhotoValidDt(photoValidDt);
542 entity.setPhotoQualifDt(photoQualifDt);
543 entity.setPhotoQualifCm(photoQualifCm);
544 entity.setUpdateDt(updateDt);
545 entity.setRemoteId(remoteId);
546 entity.setSample(sample);
547 entity.setPhotoType(photoType);
548 entity.setQualityFlag(qualityFlag);
549 entity.setObjectType(objectType);
550 entity.setRecorderDepartment(recorderDepartment);
551 entity.setSurvey(survey);
552 entity.setSamplingOperation(samplingOperation);
553 return entity;
554 }
555 }
556
557 /**
558 * @see Comparable#compareTo
559 */
560 public int compareTo(Photo o)
561 {
562 int cmp = 0;
563 if (this.getPhotoId() != null)
564 {
565 cmp = this.getPhotoId().compareTo(o.getPhotoId());
566 }
567 else
568 {
569 if (this.getObjectId() != null)
570 {
571 cmp = (cmp != 0 ? cmp : this.getObjectId().compareTo(o.getObjectId()));
572 }
573 if (this.getPhotoNm() != null)
574 {
575 cmp = (cmp != 0 ? cmp : this.getPhotoNm().compareTo(o.getPhotoNm()));
576 }
577 if (this.getPhotoDirDc() != null)
578 {
579 cmp = (cmp != 0 ? cmp : this.getPhotoDirDc().compareTo(o.getPhotoDirDc()));
580 }
581 if (this.getPhotoCm() != null)
582 {
583 cmp = (cmp != 0 ? cmp : this.getPhotoCm().compareTo(o.getPhotoCm()));
584 }
585 if (this.getPhotoLk() != null)
586 {
587 cmp = (cmp != 0 ? cmp : this.getPhotoLk().compareTo(o.getPhotoLk()));
588 }
589 if (this.getPhotoDt() != null)
590 {
591 cmp = (cmp != 0 ? cmp : this.getPhotoDt().compareTo(o.getPhotoDt()));
592 }
593 if (this.getPhotoValidDt() != null)
594 {
595 cmp = (cmp != 0 ? cmp : this.getPhotoValidDt().compareTo(o.getPhotoValidDt()));
596 }
597 if (this.getPhotoQualifDt() != null)
598 {
599 cmp = (cmp != 0 ? cmp : this.getPhotoQualifDt().compareTo(o.getPhotoQualifDt()));
600 }
601 if (this.getPhotoQualifCm() != null)
602 {
603 cmp = (cmp != 0 ? cmp : this.getPhotoQualifCm().compareTo(o.getPhotoQualifCm()));
604 }
605 if (this.getUpdateDt() != null)
606 {
607 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
608 }
609 if (this.getRemoteId() != null)
610 {
611 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
612 }
613 }
614 return cmp;
615 }
616 // HibernateEntity.vsl merge-point
617 // Photo.java merge-point
618 }