View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: Generated code! Do not modify by hand!
4   // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
5   //
6   package fr.ifremer.quadrige2.core.dao.data.aquaculture;
7   
8   /*-
9    * #%L
10   * Quadrige2 Core :: Server API
11   * %%
12   * Copyright (C) 2017 Ifremer
13   * %%
14   * This program is free software: you can redistribute it and/or modify
15   * it under the terms of the GNU Affero General Public License as published by
16   * the Free Software Foundation, either version 3 of the License, or
17   * (at your option) any later version.
18   * 
19   * This program is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   * GNU General Public License for more details.
23   * 
24   * You should have received a copy of the GNU Affero General Public License
25   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
26   * #L%
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   * Un lot est un groupe d'animaux issu d'une même population initiale et suivi sur un même point
41   * dans des conditions d'élevage similaires  (conditions expérimentales).  Un lot est défini par : *
42   * une population initiale * un lieu de surveillance * des caractéristiques d'élevage (système +
43   * structure) * un niveau Ce lot de mollusques est positionné sur le terrain.
44   */
45  // HibernateEntity.vsl annotations merge-point
46  public abstract class Batch
47      implements Serializable, Comparable<Batch>
48  {
49      /**
50       * The serial version UID of this class. Needed for serialization.
51       */
52      private static final long serialVersionUID = 7971998142476003517L;
53  
54      // Generate 12 attributes
55      private Integer batchId;
56  
57      /**
58       * Identifiant interne du lot
59       * @return this.batchId Integer
60       */
61      public Integer getBatchId()
62      {
63          return this.batchId;
64      }
65  
66      /**
67       * Identifiant interne du lot
68       * @param batchIdIn Integer
69       */
70      public void setBatchId(Integer batchIdIn)
71      {
72          this.batchId = batchIdIn;
73      }
74  
75      private String batchNm;
76  
77      /**
78       * Libellé du lot
79       * @return this.batchNm String
80       */
81      public String getBatchNm()
82      {
83          return this.batchNm;
84      }
85  
86      /**
87       * Libellé du lot
88       * @param batchNmIn String
89       */
90      public void setBatchNm(String batchNmIn)
91      {
92          this.batchNm = batchNmIn;
93      }
94  
95      private String batchLb;
96  
97      /**
98       * Mnémonique du lot
99       * @return this.batchLb String
100      */
101     public String getBatchLb()
102     {
103         return this.batchLb;
104     }
105 
106     /**
107      * Mnémonique du lot
108      * @param batchLbIn String
109      */
110     public void setBatchLb(String batchLbIn)
111     {
112         this.batchLb = batchLbIn;
113     }
114 
115     private String batchExperCond;
116 
117     /**
118      * Conditions d'expérimentation
119      * @return this.batchExperCond String
120      */
121     public String getBatchExperCond()
122     {
123         return this.batchExperCond;
124     }
125 
126     /**
127      * Conditions d'expérimentation
128      * @param batchExperCondIn String
129      */
130     public void setBatchExperCond(String batchExperCondIn)
131     {
132         this.batchExperCond = batchExperCondIn;
133     }
134 
135     private Double batchBreedingStructurUnit;
136 
137     /**
138      * Nombre d'occurences de la structure d'élevage
139      * @return this.batchBreedingStructurUnit Double
140      */
141     public Double getBatchBreedingStructurUnit()
142     {
143         return this.batchBreedingStructurUnit;
144     }
145 
146     /**
147      * Nombre d'occurences de la structure d'élevage
148      * @param batchBreedingStructurUnitIn Double
149      */
150     public void setBatchBreedingStructurUnit(Double batchBreedingStructurUnitIn)
151     {
152         this.batchBreedingStructurUnit = batchBreedingStructurUnitIn;
153     }
154 
155     private Double batchBreedingSystemUnit;
156 
157     /**
158      * Nombre d'occurences du système d'élevage
159      * @return this.batchBreedingSystemUnit Double
160      */
161     public Double getBatchBreedingSystemUnit()
162     {
163         return this.batchBreedingSystemUnit;
164     }
165 
166     /**
167      * Nombre d'occurences du système d'élevage
168      * @param batchBreedingSystemUnitIn Double
169      */
170     public void setBatchBreedingSystemUnit(Double batchBreedingSystemUnitIn)
171     {
172         this.batchBreedingSystemUnit = batchBreedingSystemUnitIn;
173     }
174 
175     private String batchCm;
176 
177     /**
178      * Commentaire sur le lot
179      * @return this.batchCm String
180      */
181     public String getBatchCm()
182     {
183         return this.batchCm;
184     }
185 
186     /**
187      * Commentaire sur le lot
188      * @param batchCmIn String
189      */
190     public void setBatchCm(String batchCmIn)
191     {
192         this.batchCm = batchCmIn;
193     }
194 
195     private Date batchControlDt;
196 
197     /**
198      * Date de contrôle du lot
199      * @return this.batchControlDt Date
200      */
201     public Date getBatchControlDt()
202     {
203         return this.batchControlDt;
204     }
205 
206     /**
207      * Date de contrôle du lot
208      * @param batchControlDtIn Date
209      */
210     public void setBatchControlDt(Date batchControlDtIn)
211     {
212         this.batchControlDt = batchControlDtIn;
213     }
214 
215     private Date batchValidDt;
216 
217     /**
218      * Date de validation du lot
219      * @return this.batchValidDt Date
220      */
221     public Date getBatchValidDt()
222     {
223         return this.batchValidDt;
224     }
225 
226     /**
227      * Date de validation du lot
228      * @param batchValidDtIn Date
229      */
230     public void setBatchValidDt(Date batchValidDtIn)
231     {
232         this.batchValidDt = batchValidDtIn;
233     }
234 
235     private Date batchQualifDt;
236 
237     /**
238      * Date de qualification du lot
239      * @return this.batchQualifDt Date
240      */
241     public Date getBatchQualifDt()
242     {
243         return this.batchQualifDt;
244     }
245 
246     /**
247      * Date de qualification du lot
248      * @param batchQualifDtIn Date
249      */
250     public void setBatchQualifDt(Date batchQualifDtIn)
251     {
252         this.batchQualifDt = batchQualifDtIn;
253     }
254 
255     private String batchQualifCm;
256 
257     /**
258      * Commentaire de qualifcation du lot
259      * @return this.batchQualifCm String
260      */
261     public String getBatchQualifCm()
262     {
263         return this.batchQualifCm;
264     }
265 
266     /**
267      * Commentaire de qualifcation du lot
268      * @param batchQualifCmIn String
269      */
270     public void setBatchQualifCm(String batchQualifCmIn)
271     {
272         this.batchQualifCm = batchQualifCmIn;
273     }
274 
275     private Timestamp updateDt;
276 
277     /**
278      * Date de maj
279      * @return this.updateDt Timestamp
280      */
281     public Timestamp getUpdateDt()
282     {
283         return this.updateDt;
284     }
285 
286     /**
287      * Date de maj
288      * @param updateDtIn Timestamp
289      */
290     public void setUpdateDt(Timestamp updateDtIn)
291     {
292         this.updateDt = updateDtIn;
293     }
294 
295     // Generate 8 associations
296     private MonitoringLocation monitoringLocation;
297 
298     /**
299      * Liste les lieux associés aux programmes de surveillance.
300      * @return this.monitoringLocation MonitoringLocation
301      */
302     public MonitoringLocation getMonitoringLocation()
303     {
304         return this.monitoringLocation;
305     }
306 
307     /**
308      * Liste les lieux associés aux programmes de surveillance.
309      * @param monitoringLocationIn MonitoringLocation
310      */
311     public void setMonitoringLocation(MonitoringLocation monitoringLocationIn)
312     {
313         this.monitoringLocation = monitoringLocationIn;
314     }
315 
316     private BreedingSystem breedingSystem;
317 
318     /**
319      * Système d'élevage
320      * C'est l'ensemble des contenants (des enceintes) ou des supports de mollusques.  Exemple = la
321      * poche,
322      * la corde, le casier, etc..
323      * @return this.breedingSystem BreedingSystem
324      */
325     public BreedingSystem getBreedingSystem()
326     {
327         return this.breedingSystem;
328     }
329 
330     /**
331      * Système d'élevage
332      * C'est l'ensemble des contenants (des enceintes) ou des supports de mollusques.  Exemple = la
333      * poche,
334      * la corde, le casier, etc..
335      * @param breedingSystemIn BreedingSystem
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      * Liste les prélévements effectués lors d'un passage.
346      * @return this.samplingOperations Collection<SamplingOperation>
347      */
348     public Collection<SamplingOperation> getSamplingOperations()
349     {
350         return this.samplingOperations;
351     }
352 
353     /**
354      * Liste les prélévements effectués lors d'un passage.
355      * @param samplingOperationsIn Collection<SamplingOperation>
356      */
357     public void setSamplingOperations(Collection<SamplingOperation> samplingOperationsIn)
358     {
359         this.samplingOperations = samplingOperationsIn;
360     }
361 
362     /**
363      * Liste les prélévements effectués lors d'un passage.
364      * @param elementToAdd SamplingOperation
365      * @return <tt>true</tt> if this collection changed as a result of the
366      *         call
367      */
368     public boolean addSamplingOperations(SamplingOperation elementToAdd)
369     {
370         return this.samplingOperations.add(elementToAdd);
371     }
372 
373     /**
374      * Liste les prélévements effectués lors d'un passage.
375      * @param elementToRemove SamplingOperation
376      * @return <tt>true</tt> if this collection changed as a result of the
377      *         call
378      */
379     public boolean removeSamplingOperations(SamplingOperation elementToRemove)
380     {
381         return this.samplingOperations.remove(elementToRemove);
382     }
383 
384     private BreedingStructure breedingStructure;
385 
386     /**
387      * Structure d'élevage
388      * C'est l'ensemble des structures qui tiennent les systèmes.  Exemple : la filière, la table,
389      * le
390      * bouchot, etc..
391      * @return this.breedingStructure BreedingStructure
392      */
393     public BreedingStructure getBreedingStructure()
394     {
395         return this.breedingStructure;
396     }
397 
398     /**
399      * Structure d'élevage
400      * C'est l'ensemble des structures qui tiennent les systèmes.  Exemple : la filière, la table,
401      * le
402      * bouchot, etc..
403      * @param breedingStructureIn BreedingStructure
404      */
405     public void setBreedingStructure(BreedingStructure breedingStructureIn)
406     {
407         this.breedingStructure = breedingStructureIn;
408     }
409 
410     private DepthLevel depthLevel;
411 
412     /**
413      * Liste des niveaux auxquels les prélèvements peuvent être effectués.
414      * @return this.depthLevel DepthLevel
415      */
416     public DepthLevel getDepthLevel()
417     {
418         return this.depthLevel;
419     }
420 
421     /**
422      * Liste des niveaux auxquels les prélèvements peuvent être effectués.
423      * @param depthLevelIn DepthLevel
424      */
425     public void setDepthLevel(DepthLevel depthLevelIn)
426     {
427         this.depthLevel = depthLevelIn;
428     }
429 
430     private InitialPopulation initialPopulation;
431 
432     /**
433      * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
434      * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
435      * Cela
436      * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
437      * mollusques, que
438      * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
439      * sur
440      * différents lieux de mesures.
441      * @return this.initialPopulation InitialPopulation
442      */
443     public InitialPopulation getInitialPopulation()
444     {
445         return this.initialPopulation;
446     }
447 
448     /**
449      * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
450      * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
451      * Cela
452      * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
453      * mollusques, que
454      * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
455      * sur
456      * différents lieux de mesures.
457      * @param initialPopulationIn InitialPopulation
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      * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
468      * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
469      * Cela
470      * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
471      * mollusques, que
472      * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
473      * sur
474      * différents lieux de mesures.
475      * @return this.initialPopulations Collection<InitialPopulation>
476      */
477     public Collection<InitialPopulation> getInitialPopulations()
478     {
479         return this.initialPopulations;
480     }
481 
482     /**
483      * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
484      * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
485      * Cela
486      * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
487      * mollusques, que
488      * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
489      * sur
490      * différents lieux de mesures.
491      * @param initialPopulationsIn Collection<InitialPopulation>
492      */
493     public void setInitialPopulations(Collection<InitialPopulation> initialPopulationsIn)
494     {
495         this.initialPopulations = initialPopulationsIn;
496     }
497 
498     /**
499      * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
500      * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
501      * Cela
502      * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
503      * mollusques, que
504      * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
505      * sur
506      * différents lieux de mesures.
507      * @param elementToAdd InitialPopulation
508      * @return <tt>true</tt> if this collection changed as a result of the
509      *         call
510      */
511     public boolean addInitialPopulations(InitialPopulation elementToAdd)
512     {
513         return this.initialPopulations.add(elementToAdd);
514     }
515 
516     /**
517      * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
518      * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
519      * Cela
520      * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
521      * mollusques, que
522      * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
523      * sur
524      * différents lieux de mesures.
525      * @param elementToRemove InitialPopulation
526      * @return <tt>true</tt> if this collection changed as a result of the
527      *         call
528      */
529     public boolean removeInitialPopulations(InitialPopulation elementToRemove)
530     {
531         return this.initialPopulations.remove(elementToRemove);
532     }
533 
534     private QualityFlag qualityFlag;
535 
536     /**
537      * Liste des niveaux de qualification.
538      * @return this.qualityFlag QualityFlag
539      */
540     public QualityFlag getQualityFlag()
541     {
542         return this.qualityFlag;
543     }
544 
545     /**
546      * Liste des niveaux de qualification.
547      * @param qualityFlagIn QualityFlag
548      */
549     public void setQualityFlag(QualityFlag qualityFlagIn)
550     {
551         this.qualityFlag = qualityFlagIn;
552     }
553 
554     /**
555      * Returns <code>true</code> if the argument is an Batch instance and all identifiers for this entity
556      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
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      * Returns a hash code based on this entity's identifiers.
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      * Constructs new instances of {@link Batch}.
591      */
592     public static final class Factory
593     {
594         /**
595          * Constructs a new instance of {@link Batch}.
596          * @return new BatchImpl()
597          */
598         public static Batch newInstance()
599         {
600             return new BatchImpl();
601         }
602 
603         /**
604          * Constructs a new instance of {@link Batch}, taking all required and/or
605          * read-only properties as arguments, except for identifiers.
606          * @param batchNm String
607          * @param batchLb String
608          * @param updateDt Timestamp
609          * @param monitoringLocation MonitoringLocation
610          * @param breedingSystem BreedingSystem
611          * @param breedingStructure BreedingStructure
612          * @param initialPopulation InitialPopulation
613          * @param qualityFlag QualityFlag
614          * @return newInstance
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          * Constructs a new instance of {@link Batch}, taking all possible properties
632          * (except the identifier(s))as arguments.
633          * @param batchNm String
634          * @param batchLb String
635          * @param batchExperCond String
636          * @param batchBreedingStructurUnit Double
637          * @param batchBreedingSystemUnit Double
638          * @param batchCm String
639          * @param batchControlDt Date
640          * @param batchValidDt Date
641          * @param batchQualifDt Date
642          * @param batchQualifCm String
643          * @param updateDt Timestamp
644          * @param monitoringLocation MonitoringLocation
645          * @param breedingSystem BreedingSystem
646          * @param samplingOperations Collection<SamplingOperation>
647          * @param breedingStructure BreedingStructure
648          * @param depthLevel DepthLevel
649          * @param initialPopulation InitialPopulation
650          * @param initialPopulations Collection<InitialPopulation>
651          * @param qualityFlag QualityFlag
652          * @return newInstance Batch
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      * @see Comparable#compareTo
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 // HibernateEntity.vsl merge-point
740 // Batch.java merge-point
741 }