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