1
2
3
4
5
6 package fr.ifremer.quadrige2.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
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
39
40
41 public abstract class Photo
42 implements Serializable, Comparable<Photo>
43 {
44
45
46
47 private static final long serialVersionUID = -5058070750062956317L;
48
49
50 private Integer photoId;
51
52
53
54
55
56 public Integer getPhotoId()
57 {
58 return this.photoId;
59 }
60
61
62
63
64
65 public void setPhotoId(Integer photoIdIn)
66 {
67 this.photoId = photoIdIn;
68 }
69
70 private Integer objectId;
71
72
73
74
75
76 public Integer getObjectId()
77 {
78 return this.objectId;
79 }
80
81
82
83
84
85 public void setObjectId(Integer objectIdIn)
86 {
87 this.objectId = objectIdIn;
88 }
89
90 private String photoNm;
91
92
93
94
95
96 public String getPhotoNm()
97 {
98 return this.photoNm;
99 }
100
101
102
103
104
105 public void setPhotoNm(String photoNmIn)
106 {
107 this.photoNm = photoNmIn;
108 }
109
110 private String photoDirDc;
111
112
113
114
115
116 public String getPhotoDirDc()
117 {
118 return this.photoDirDc;
119 }
120
121
122
123
124
125 public void setPhotoDirDc(String photoDirDcIn)
126 {
127 this.photoDirDc = photoDirDcIn;
128 }
129
130 private String photoCm;
131
132
133
134
135
136 public String getPhotoCm()
137 {
138 return this.photoCm;
139 }
140
141
142
143
144
145 public void setPhotoCm(String photoCmIn)
146 {
147 this.photoCm = photoCmIn;
148 }
149
150 private String photoLk;
151
152
153
154
155
156
157
158 public String getPhotoLk()
159 {
160 return this.photoLk;
161 }
162
163
164
165
166
167
168
169 public void setPhotoLk(String photoLkIn)
170 {
171 this.photoLk = photoLkIn;
172 }
173
174 private Date photoDt;
175
176
177
178
179
180 public Date getPhotoDt()
181 {
182 return this.photoDt;
183 }
184
185
186
187
188
189 public void setPhotoDt(Date photoDtIn)
190 {
191 this.photoDt = photoDtIn;
192 }
193
194 private Date photoValidDt;
195
196
197
198
199
200 public Date getPhotoValidDt()
201 {
202 return this.photoValidDt;
203 }
204
205
206
207
208
209 public void setPhotoValidDt(Date photoValidDtIn)
210 {
211 this.photoValidDt = photoValidDtIn;
212 }
213
214 private Date photoQualifDt;
215
216
217
218
219
220 public Date getPhotoQualifDt()
221 {
222 return this.photoQualifDt;
223 }
224
225
226
227
228
229 public void setPhotoQualifDt(Date photoQualifDtIn)
230 {
231 this.photoQualifDt = photoQualifDtIn;
232 }
233
234 private String photoQualifCm;
235
236
237
238
239
240 public String getPhotoQualifCm()
241 {
242 return this.photoQualifCm;
243 }
244
245
246
247
248
249 public void setPhotoQualifCm(String photoQualifCmIn)
250 {
251 this.photoQualifCm = photoQualifCmIn;
252 }
253
254 private Timestamp updateDt;
255
256
257
258
259
260 public Timestamp getUpdateDt()
261 {
262 return this.updateDt;
263 }
264
265
266
267
268
269 public void setUpdateDt(Timestamp updateDtIn)
270 {
271 this.updateDt = updateDtIn;
272 }
273
274
275 private PhotoType photoType;
276
277
278
279
280
281 public PhotoType getPhotoType()
282 {
283 return this.photoType;
284 }
285
286
287
288
289
290 public void setPhotoType(PhotoType photoTypeIn)
291 {
292 this.photoType = photoTypeIn;
293 }
294
295 private QualityFlag qualityFlag;
296
297
298
299
300
301 public QualityFlag getQualityFlag()
302 {
303 return this.qualityFlag;
304 }
305
306
307
308
309
310 public void setQualityFlag(QualityFlag qualityFlagIn)
311 {
312 this.qualityFlag = qualityFlagIn;
313 }
314
315 private ObjectType objectType;
316
317
318
319
320
321
322
323 public ObjectType getObjectType()
324 {
325 return this.objectType;
326 }
327
328
329
330
331
332
333
334 public void setObjectType(ObjectType objectTypeIn)
335 {
336 this.objectType = objectTypeIn;
337 }
338
339 private Department recorderDepartment;
340
341
342
343
344
345 public Department getRecorderDepartment()
346 {
347 return this.recorderDepartment;
348 }
349
350
351
352
353
354 public void setRecorderDepartment(Department recorderDepartmentIn)
355 {
356 this.recorderDepartment = recorderDepartmentIn;
357 }
358
359
360
361
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
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
396
397 public static final class Factory
398 {
399
400
401
402
403 public static Photo newInstance()
404 {
405 return new PhotoImpl();
406 }
407
408
409
410
411
412
413
414
415
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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
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
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
523
524 }