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