1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.data.measurement;
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.program.Program;
29 import fr.ifremer.quadrige3.core.dao.administration.user.Department;
30 import fr.ifremer.quadrige3.core.dao.data.sample.Sample;
31 import fr.ifremer.quadrige3.core.dao.data.samplingoperation.SamplingOperation;
32 import fr.ifremer.quadrige3.core.dao.data.survey.Survey;
33 import fr.ifremer.quadrige3.core.dao.referential.AnalysisInstrument;
34 import fr.ifremer.quadrige3.core.dao.referential.ObjectType;
35 import fr.ifremer.quadrige3.core.dao.referential.QualityFlag;
36 import fr.ifremer.quadrige3.core.dao.referential.pmfm.Pmfm;
37 import java.io.Serializable;
38 import java.sql.Timestamp;
39 import java.util.Collection;
40 import java.util.Date;
41 import java.util.HashSet;
42
43
44
45
46
47 public abstract class MeasurementFile
48 implements Serializable, Comparable<MeasurementFile>
49 {
50
51
52
53 private static final long serialVersionUID = -6780794383458321997L;
54
55
56 private Integer measFileId;
57
58
59
60
61
62 public Integer getMeasFileId()
63 {
64 return this.measFileId;
65 }
66
67
68
69
70
71 public void setMeasFileId(Integer measFileIdIn)
72 {
73 this.measFileId = measFileIdIn;
74 }
75
76 private Integer objectId;
77
78
79
80
81
82 public Integer getObjectId()
83 {
84 return this.objectId;
85 }
86
87
88
89
90
91 public void setObjectId(Integer objectIdIn)
92 {
93 this.objectId = objectIdIn;
94 }
95
96 private String measFilePathNm;
97
98
99
100
101
102 public String getMeasFilePathNm()
103 {
104 return this.measFilePathNm;
105 }
106
107
108
109
110
111 public void setMeasFilePathNm(String measFilePathNmIn)
112 {
113 this.measFilePathNm = measFilePathNmIn;
114 }
115
116 private String measFileNm;
117
118
119
120
121
122 public String getMeasFileNm()
123 {
124 return this.measFileNm;
125 }
126
127
128
129
130
131 public void setMeasFileNm(String measFileNmIn)
132 {
133 this.measFileNm = measFileNmIn;
134 }
135
136 private String measFileCm;
137
138
139
140
141
142 public String getMeasFileCm()
143 {
144 return this.measFileCm;
145 }
146
147
148
149
150
151 public void setMeasFileCm(String measFileCmIn)
152 {
153 this.measFileCm = measFileCmIn;
154 }
155
156 private Date measFileValidDt;
157
158
159
160
161
162 public Date getMeasFileValidDt()
163 {
164 return this.measFileValidDt;
165 }
166
167
168
169
170
171 public void setMeasFileValidDt(Date measFileValidDtIn)
172 {
173 this.measFileValidDt = measFileValidDtIn;
174 }
175
176 private Date measFileControlDt;
177
178
179
180
181
182 public Date getMeasFileControlDt()
183 {
184 return this.measFileControlDt;
185 }
186
187
188
189
190
191 public void setMeasFileControlDt(Date measFileControlDtIn)
192 {
193 this.measFileControlDt = measFileControlDtIn;
194 }
195
196 private Date measFileQualifDt;
197
198
199
200
201
202 public Date getMeasFileQualifDt()
203 {
204 return this.measFileQualifDt;
205 }
206
207
208
209
210
211 public void setMeasFileQualifDt(Date measFileQualifDtIn)
212 {
213 this.measFileQualifDt = measFileQualifDtIn;
214 }
215
216 private String measFileQualifCm;
217
218
219
220
221
222
223 public String getMeasFileQualifCm()
224 {
225 return this.measFileQualifCm;
226 }
227
228
229
230
231
232
233 public void setMeasFileQualifCm(String measFileQualifCmIn)
234 {
235 this.measFileQualifCm = measFileQualifCmIn;
236 }
237
238 private Timestamp updateDt;
239
240
241
242
243
244 public Timestamp getUpdateDt()
245 {
246 return this.updateDt;
247 }
248
249
250
251
252
253 public void setUpdateDt(Timestamp updateDtIn)
254 {
255 this.updateDt = updateDtIn;
256 }
257
258 private Integer remoteId;
259
260
261
262
263
264 public Integer getRemoteId()
265 {
266 return this.remoteId;
267 }
268
269
270
271
272
273 public void setRemoteId(Integer remoteIdIn)
274 {
275 this.remoteId = remoteIdIn;
276 }
277
278
279 private Sample sample;
280
281
282
283
284
285 public Sample getSample()
286 {
287 return this.sample;
288 }
289
290
291
292
293
294 public void setSample(Sample sampleIn)
295 {
296 this.sample = sampleIn;
297 }
298
299 private ObjectType objectType;
300
301
302
303
304
305
306
307 public ObjectType getObjectType()
308 {
309 return this.objectType;
310 }
311
312
313
314
315
316
317
318 public void setObjectType(ObjectType objectTypeIn)
319 {
320 this.objectType = objectTypeIn;
321 }
322
323 private QualityFlag qualityFlag;
324
325
326
327
328
329 public QualityFlag getQualityFlag()
330 {
331 return this.qualityFlag;
332 }
333
334
335
336
337
338 public void setQualityFlag(QualityFlag qualityFlagIn)
339 {
340 this.qualityFlag = qualityFlagIn;
341 }
342
343 private Department department;
344
345
346
347
348
349 public Department getDepartment()
350 {
351 return this.department;
352 }
353
354
355
356
357
358 public void setDepartment(Department departmentIn)
359 {
360 this.department = departmentIn;
361 }
362
363 private Collection<Program> programs = new HashSet<Program>();
364
365
366
367
368
369 public Collection<Program> getPrograms()
370 {
371 return this.programs;
372 }
373
374
375
376
377
378 public void setPrograms(Collection<Program> programsIn)
379 {
380 this.programs = programsIn;
381 }
382
383
384
385
386
387
388
389 public boolean addPrograms(Program elementToAdd)
390 {
391 return this.programs.add(elementToAdd);
392 }
393
394
395
396
397
398
399
400 public boolean removePrograms(Program elementToRemove)
401 {
402 return this.programs.remove(elementToRemove);
403 }
404
405 private Pmfm pmfm;
406
407
408
409
410
411 public Pmfm getPmfm()
412 {
413 return this.pmfm;
414 }
415
416
417
418
419
420 public void setPmfm(Pmfm pmfmIn)
421 {
422 this.pmfm = pmfmIn;
423 }
424
425 private AnalysisInstrument analysisInstrument;
426
427
428
429
430
431 public AnalysisInstrument getAnalysisInstrument()
432 {
433 return this.analysisInstrument;
434 }
435
436
437
438
439
440 public void setAnalysisInstrument(AnalysisInstrument analysisInstrumentIn)
441 {
442 this.analysisInstrument = analysisInstrumentIn;
443 }
444
445 private Department recorderDepartment;
446
447
448
449
450
451 public Department getRecorderDepartment()
452 {
453 return this.recorderDepartment;
454 }
455
456
457
458
459
460 public void setRecorderDepartment(Department recorderDepartmentIn)
461 {
462 this.recorderDepartment = recorderDepartmentIn;
463 }
464
465 private Survey survey;
466
467
468
469
470
471
472 public Survey getSurvey()
473 {
474 return this.survey;
475 }
476
477
478
479
480
481
482 public void setSurvey(Survey surveyIn)
483 {
484 this.survey = surveyIn;
485 }
486
487 private SamplingOperation samplingOperation;
488
489
490
491
492
493 public SamplingOperation getSamplingOperation()
494 {
495 return this.samplingOperation;
496 }
497
498
499
500
501
502 public void setSamplingOperation(SamplingOperation samplingOperationIn)
503 {
504 this.samplingOperation = samplingOperationIn;
505 }
506
507
508
509
510
511 @Override
512 public boolean equals(Object object)
513 {
514 if (this == object)
515 {
516 return true;
517 }
518 if (!(object instanceof MeasurementFile))
519 {
520 return false;
521 }
522 final MeasurementFile that = (MeasurementFile)object;
523 if (this.measFileId == null || that.getMeasFileId() == null || !this.measFileId.equals(that.getMeasFileId()))
524 {
525 return false;
526 }
527 return true;
528 }
529
530
531
532
533 @Override
534 public int hashCode()
535 {
536 int hashCode = 0;
537 hashCode = 29 * hashCode + (this.measFileId == null ? 0 : this.measFileId.hashCode());
538
539 return hashCode;
540 }
541
542
543
544
545 public static final class Factory
546 {
547
548
549
550
551 public static MeasurementFile newInstance()
552 {
553 return new MeasurementFileImpl();
554 }
555
556
557
558
559
560
561
562
563
564
565
566 public static MeasurementFile newInstance(Integer objectId, String measFilePathNm, ObjectType objectType, QualityFlag qualityFlag, Pmfm pmfm)
567 {
568 final MeasurementFile entity = new MeasurementFileImpl();
569 entity.setObjectId(objectId);
570 entity.setMeasFilePathNm(measFilePathNm);
571 entity.setObjectType(objectType);
572 entity.setQualityFlag(qualityFlag);
573 entity.setPmfm(pmfm);
574 return entity;
575 }
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602 public static MeasurementFile newInstance(Integer objectId, String measFilePathNm, String measFileNm, String measFileCm, Date measFileValidDt, Date measFileControlDt, Date measFileQualifDt, String measFileQualifCm, Timestamp updateDt, Integer remoteId, Sample sample, ObjectType objectType, QualityFlag qualityFlag, Department department, Collection<Program> programs, Pmfm pmfm, AnalysisInstrument analysisInstrument, Department recorderDepartment, Survey survey, SamplingOperation samplingOperation)
603 {
604 final MeasurementFile entity = new MeasurementFileImpl();
605 entity.setObjectId(objectId);
606 entity.setMeasFilePathNm(measFilePathNm);
607 entity.setMeasFileNm(measFileNm);
608 entity.setMeasFileCm(measFileCm);
609 entity.setMeasFileValidDt(measFileValidDt);
610 entity.setMeasFileControlDt(measFileControlDt);
611 entity.setMeasFileQualifDt(measFileQualifDt);
612 entity.setMeasFileQualifCm(measFileQualifCm);
613 entity.setUpdateDt(updateDt);
614 entity.setRemoteId(remoteId);
615 entity.setSample(sample);
616 entity.setObjectType(objectType);
617 entity.setQualityFlag(qualityFlag);
618 entity.setDepartment(department);
619 entity.setPrograms(programs);
620 entity.setPmfm(pmfm);
621 entity.setAnalysisInstrument(analysisInstrument);
622 entity.setRecorderDepartment(recorderDepartment);
623 entity.setSurvey(survey);
624 entity.setSamplingOperation(samplingOperation);
625 return entity;
626 }
627 }
628
629
630
631
632 public int compareTo(MeasurementFile o)
633 {
634 int cmp = 0;
635 if (this.getMeasFileId() != null)
636 {
637 cmp = this.getMeasFileId().compareTo(o.getMeasFileId());
638 }
639 else
640 {
641 if (this.getObjectId() != null)
642 {
643 cmp = (cmp != 0 ? cmp : this.getObjectId().compareTo(o.getObjectId()));
644 }
645 if (this.getMeasFilePathNm() != null)
646 {
647 cmp = (cmp != 0 ? cmp : this.getMeasFilePathNm().compareTo(o.getMeasFilePathNm()));
648 }
649 if (this.getMeasFileNm() != null)
650 {
651 cmp = (cmp != 0 ? cmp : this.getMeasFileNm().compareTo(o.getMeasFileNm()));
652 }
653 if (this.getMeasFileCm() != null)
654 {
655 cmp = (cmp != 0 ? cmp : this.getMeasFileCm().compareTo(o.getMeasFileCm()));
656 }
657 if (this.getMeasFileValidDt() != null)
658 {
659 cmp = (cmp != 0 ? cmp : this.getMeasFileValidDt().compareTo(o.getMeasFileValidDt()));
660 }
661 if (this.getMeasFileControlDt() != null)
662 {
663 cmp = (cmp != 0 ? cmp : this.getMeasFileControlDt().compareTo(o.getMeasFileControlDt()));
664 }
665 if (this.getMeasFileQualifDt() != null)
666 {
667 cmp = (cmp != 0 ? cmp : this.getMeasFileQualifDt().compareTo(o.getMeasFileQualifDt()));
668 }
669 if (this.getMeasFileQualifCm() != null)
670 {
671 cmp = (cmp != 0 ? cmp : this.getMeasFileQualifCm().compareTo(o.getMeasFileQualifCm()));
672 }
673 if (this.getUpdateDt() != null)
674 {
675 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
676 }
677 if (this.getRemoteId() != null)
678 {
679 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
680 }
681 }
682 return cmp;
683 }
684
685
686 }