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