1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.data.photo;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
41
42
43 public abstract class Photo
44 implements Serializable, Comparable<Photo>
45 {
46
47
48
49 private static final long serialVersionUID = -1034938653766129666L;
50
51
52 private Integer photoId;
53
54
55
56
57
58 public Integer getPhotoId()
59 {
60 return this.photoId;
61 }
62
63
64
65
66
67 public void setPhotoId(Integer photoIdIn)
68 {
69 this.photoId = photoIdIn;
70 }
71
72 private Integer objectId;
73
74
75
76
77
78 public Integer getObjectId()
79 {
80 return this.objectId;
81 }
82
83
84
85
86
87 public void setObjectId(Integer objectIdIn)
88 {
89 this.objectId = objectIdIn;
90 }
91
92 private String photoNm;
93
94
95
96
97
98 public String getPhotoNm()
99 {
100 return this.photoNm;
101 }
102
103
104
105
106
107 public void setPhotoNm(String photoNmIn)
108 {
109 this.photoNm = photoNmIn;
110 }
111
112 private String photoDirDc;
113
114
115
116
117
118 public String getPhotoDirDc()
119 {
120 return this.photoDirDc;
121 }
122
123
124
125
126
127 public void setPhotoDirDc(String photoDirDcIn)
128 {
129 this.photoDirDc = photoDirDcIn;
130 }
131
132 private String photoCm;
133
134
135
136
137
138 public String getPhotoCm()
139 {
140 return this.photoCm;
141 }
142
143
144
145
146
147 public void setPhotoCm(String photoCmIn)
148 {
149 this.photoCm = photoCmIn;
150 }
151
152 private String photoLk;
153
154
155
156
157
158
159
160 public String getPhotoLk()
161 {
162 return this.photoLk;
163 }
164
165
166
167
168
169
170
171 public void setPhotoLk(String photoLkIn)
172 {
173 this.photoLk = photoLkIn;
174 }
175
176 private Date photoDt;
177
178
179
180
181
182 public Date getPhotoDt()
183 {
184 return this.photoDt;
185 }
186
187
188
189
190
191 public void setPhotoDt(Date photoDtIn)
192 {
193 this.photoDt = photoDtIn;
194 }
195
196 private Date photoValidDt;
197
198
199
200
201
202 public Date getPhotoValidDt()
203 {
204 return this.photoValidDt;
205 }
206
207
208
209
210
211 public void setPhotoValidDt(Date photoValidDtIn)
212 {
213 this.photoValidDt = photoValidDtIn;
214 }
215
216 private Date photoQualifDt;
217
218
219
220
221
222 public Date getPhotoQualifDt()
223 {
224 return this.photoQualifDt;
225 }
226
227
228
229
230
231 public void setPhotoQualifDt(Date photoQualifDtIn)
232 {
233 this.photoQualifDt = photoQualifDtIn;
234 }
235
236 private String photoQualifCm;
237
238
239
240
241
242 public String getPhotoQualifCm()
243 {
244 return this.photoQualifCm;
245 }
246
247
248
249
250
251 public void setPhotoQualifCm(String photoQualifCmIn)
252 {
253 this.photoQualifCm = photoQualifCmIn;
254 }
255
256 private Timestamp updateDt;
257
258
259
260
261
262 public Timestamp getUpdateDt()
263 {
264 return this.updateDt;
265 }
266
267
268
269
270
271 public void setUpdateDt(Timestamp updateDtIn)
272 {
273 this.updateDt = updateDtIn;
274 }
275
276 private Integer remoteId;
277
278
279
280
281
282 public Integer getRemoteId()
283 {
284 return this.remoteId;
285 }
286
287
288
289
290
291 public void setRemoteId(Integer remoteIdIn)
292 {
293 this.remoteId = remoteIdIn;
294 }
295
296
297 private Sample sample;
298
299
300
301
302
303 public Sample getSample()
304 {
305 return this.sample;
306 }
307
308
309
310
311
312 public void setSample(Sample sampleIn)
313 {
314 this.sample = sampleIn;
315 }
316
317 private PhotoType photoType;
318
319
320
321
322
323 public PhotoType getPhotoType()
324 {
325 return this.photoType;
326 }
327
328
329
330
331
332 public void setPhotoType(PhotoType photoTypeIn)
333 {
334 this.photoType = photoTypeIn;
335 }
336
337 private QualityFlag qualityFlag;
338
339
340
341
342
343 public QualityFlag getQualityFlag()
344 {
345 return this.qualityFlag;
346 }
347
348
349
350
351
352 public void setQualityFlag(QualityFlag qualityFlagIn)
353 {
354 this.qualityFlag = qualityFlagIn;
355 }
356
357 private ObjectType objectType;
358
359
360
361
362
363
364
365 public ObjectType getObjectType()
366 {
367 return this.objectType;
368 }
369
370
371
372
373
374
375
376 public void setObjectType(ObjectType objectTypeIn)
377 {
378 this.objectType = objectTypeIn;
379 }
380
381 private Department recorderDepartment;
382
383
384
385
386
387 public Department getRecorderDepartment()
388 {
389 return this.recorderDepartment;
390 }
391
392
393
394
395
396 public void setRecorderDepartment(Department recorderDepartmentIn)
397 {
398 this.recorderDepartment = recorderDepartmentIn;
399 }
400
401 private Survey survey;
402
403
404
405
406
407
408 public Survey getSurvey()
409 {
410 return this.survey;
411 }
412
413
414
415
416
417
418 public void setSurvey(Survey surveyIn)
419 {
420 this.survey = surveyIn;
421 }
422
423 private SamplingOperation samplingOperation;
424
425
426
427
428
429 public SamplingOperation getSamplingOperation()
430 {
431 return this.samplingOperation;
432 }
433
434
435
436
437
438 public void setSamplingOperation(SamplingOperation samplingOperationIn)
439 {
440 this.samplingOperation = samplingOperationIn;
441 }
442
443
444
445
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
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
480
481 public static final class Factory
482 {
483
484
485
486
487 public static Photo newInstance()
488 {
489 return new PhotoImpl();
490 }
491
492
493
494
495
496
497
498
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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
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
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
617
618 }