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