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.referential.taxon;
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.referential.Status;
30  import fr.ifremer.quadrige2.core.dao.referential.TaxonGroupType;
31  import fr.ifremer.quadrige2.core.dao.referential.monitoringLocation.TaxonGroupPosition;
32  import fr.ifremer.quadrige2.core.dao.sandre.SandreTaxonGroupExp;
33  import fr.ifremer.quadrige2.core.dao.sandre.SandreTaxonGroupImp;
34  import java.io.Serializable;
35  import java.sql.Timestamp;
36  import java.util.Collection;
37  import java.util.Date;
38  import java.util.HashSet;
39  
40  /**
41   * Liste l'ensemble de taxons ayant les mêmes caractéristiques pour le critère pris en compte.
42   */
43  // HibernateEntity.vsl annotations merge-point
44  public abstract class TaxonGroup
45      implements Serializable, Comparable<TaxonGroup>
46  {
47      /**
48       * The serial version UID of this class. Needed for serialization.
49       */
50      private static final long serialVersionUID = -7685359745665279044L;
51  
52      // Generate 8 attributes
53      private Integer taxonGroupId;
54  
55      /**
56       * Identifiant interne du groupe de taxon.
57       * @return this.taxonGroupId Integer
58       */
59      public Integer getTaxonGroupId()
60      {
61          return this.taxonGroupId;
62      }
63  
64      /**
65       * Identifiant interne du groupe de taxon.
66       * @param taxonGroupIdIn Integer
67       */
68      public void setTaxonGroupId(Integer taxonGroupIdIn)
69      {
70          this.taxonGroupId = taxonGroupIdIn;
71      }
72  
73      private String taxonGroupNm;
74  
75      /**
76       * Nom officiel du groupe de taxon (euryhalin, sténohalin, mobile, ...)
77       * @return this.taxonGroupNm String
78       */
79      public String getTaxonGroupNm()
80      {
81          return this.taxonGroupNm;
82      }
83  
84      /**
85       * Nom officiel du groupe de taxon (euryhalin, sténohalin, mobile, ...)
86       * @param taxonGroupNmIn String
87       */
88      public void setTaxonGroupNm(String taxonGroupNmIn)
89      {
90          this.taxonGroupNm = taxonGroupNmIn;
91      }
92  
93      private String taxonGroupLb;
94  
95      /**
96       * Chaine de caractère permettant la recherche du taxon.
97       * @return this.taxonGroupLb String
98       */
99      public String getTaxonGroupLb()
100     {
101         return this.taxonGroupLb;
102     }
103 
104     /**
105      * Chaine de caractère permettant la recherche du taxon.
106      * @param taxonGroupLbIn String
107      */
108     public void setTaxonGroupLb(String taxonGroupLbIn)
109     {
110         this.taxonGroupLb = taxonGroupLbIn;
111     }
112 
113     private String taxonGroupCm;
114 
115     /**
116      * Commentaire sur le groupe de taxon
117      * @return this.taxonGroupCm String
118      */
119     public String getTaxonGroupCm()
120     {
121         return this.taxonGroupCm;
122     }
123 
124     /**
125      * Commentaire sur le groupe de taxon
126      * @param taxonGroupCmIn String
127      */
128     public void setTaxonGroupCm(String taxonGroupCmIn)
129     {
130         this.taxonGroupCm = taxonGroupCmIn;
131     }
132 
133     private String taxonGroupExclus;
134 
135     /**
136      * Indique si les groupes de taxons fils sont exclusifs ou non. Par défaut, les fils ne sont pas
137      * exclusifs. S'ils sont exclusifs, un même taxon ne pourra pas faire parti de plusieurs groupes
138      * du taxon père porteur de cette information.
139      * @return this.taxonGroupExclus String
140      */
141     public String getTaxonGroupExclus()
142     {
143         return this.taxonGroupExclus;
144     }
145 
146     /**
147      * Indique si les groupes de taxons fils sont exclusifs ou non. Par défaut, les fils ne sont pas
148      * exclusifs. S'ils sont exclusifs, un même taxon ne pourra pas faire parti de plusieurs groupes
149      * du taxon père porteur de cette information.
150      * @param taxonGroupExclusIn String
151      */
152     public void setTaxonGroupExclus(String taxonGroupExclusIn)
153     {
154         this.taxonGroupExclus = taxonGroupExclusIn;
155     }
156 
157     private String taxonGroupUpdate;
158 
159     /**
160      * Indique si un groupe de taxons est modifiable ou non dans l'interface de mise à jour. Pour le
161      * benthos, les groupes de type descriptif sont systématiquement définis comme non modifiables.
162      * @return this.taxonGroupUpdate String
163      */
164     public String getTaxonGroupUpdate()
165     {
166         return this.taxonGroupUpdate;
167     }
168 
169     /**
170      * Indique si un groupe de taxons est modifiable ou non dans l'interface de mise à jour. Pour le
171      * benthos, les groupes de type descriptif sont systématiquement définis comme non modifiables.
172      * @param taxonGroupUpdateIn String
173      */
174     public void setTaxonGroupUpdate(String taxonGroupUpdateIn)
175     {
176         this.taxonGroupUpdate = taxonGroupUpdateIn;
177     }
178 
179     private Date taxonGroupCreationDt;
180 
181     /**
182      * Date de création de l'objet
183      * @return this.taxonGroupCreationDt Date
184      */
185     public Date getTaxonGroupCreationDt()
186     {
187         return this.taxonGroupCreationDt;
188     }
189 
190     /**
191      * Date de création de l'objet
192      * @param taxonGroupCreationDtIn Date
193      */
194     public void setTaxonGroupCreationDt(Date taxonGroupCreationDtIn)
195     {
196         this.taxonGroupCreationDt = taxonGroupCreationDtIn;
197     }
198 
199     private Timestamp updateDt;
200 
201     /**
202      * Date de maj de l'objet
203      * @return this.updateDt Timestamp
204      */
205     public Timestamp getUpdateDt()
206     {
207         return this.updateDt;
208     }
209 
210     /**
211      * Date de maj de l'objet
212      * @param updateDtIn Timestamp
213      */
214     public void setUpdateDt(Timestamp updateDtIn)
215     {
216         this.updateDt = updateDtIn;
217     }
218 
219     // Generate 13 associations
220     private Collection<SandreTaxonGroupImp> sandreTaxonGroupImpIds = new HashSet<SandreTaxonGroupImp>();
221 
222     /**
223      * Groupe de taxons sandre pour les imports de données
224      * @return this.sandreTaxonGroupImpIds Collection<SandreTaxonGroupImp>
225      */
226     public Collection<SandreTaxonGroupImp> getSandreTaxonGroupImpIds()
227     {
228         return this.sandreTaxonGroupImpIds;
229     }
230 
231     /**
232      * Groupe de taxons sandre pour les imports de données
233      * @param sandreTaxonGroupImpIdsIn Collection<SandreTaxonGroupImp>
234      */
235     public void setSandreTaxonGroupImpIds(Collection<SandreTaxonGroupImp> sandreTaxonGroupImpIdsIn)
236     {
237         this.sandreTaxonGroupImpIds = sandreTaxonGroupImpIdsIn;
238     }
239 
240     /**
241      * Groupe de taxons sandre pour les imports de données
242      * @param elementToAdd SandreTaxonGroupImp
243      * @return <tt>true</tt> if this collection changed as a result of the
244      *         call
245      */
246     public boolean addSandreTaxonGroupImpIds(SandreTaxonGroupImp elementToAdd)
247     {
248         return this.sandreTaxonGroupImpIds.add(elementToAdd);
249     }
250 
251     /**
252      * Groupe de taxons sandre pour les imports de données
253      * @param elementToRemove SandreTaxonGroupImp
254      * @return <tt>true</tt> if this collection changed as a result of the
255      *         call
256      */
257     public boolean removeSandreTaxonGroupImpIds(SandreTaxonGroupImp elementToRemove)
258     {
259         return this.sandreTaxonGroupImpIds.remove(elementToRemove);
260     }
261 
262     private Collection<TaxonGroup> taxonGroups = new HashSet<TaxonGroup>();
263 
264     /**
265      * Liste l'ensemble de taxons ayant les mêmes caractéristiques pour le critère pris en compte.
266      * @return this.taxonGroups Collection<TaxonGroup>
267      */
268     public Collection<TaxonGroup> getTaxonGroups()
269     {
270         return this.taxonGroups;
271     }
272 
273     /**
274      * Liste l'ensemble de taxons ayant les mêmes caractéristiques pour le critère pris en compte.
275      * @param taxonGroupsIn Collection<TaxonGroup>
276      */
277     public void setTaxonGroups(Collection<TaxonGroup> taxonGroupsIn)
278     {
279         this.taxonGroups = taxonGroupsIn;
280     }
281 
282     /**
283      * Liste l'ensemble de taxons ayant les mêmes caractéristiques pour le critère pris en compte.
284      * @param elementToAdd TaxonGroup
285      * @return <tt>true</tt> if this collection changed as a result of the
286      *         call
287      */
288     public boolean addTaxonGroups(TaxonGroup elementToAdd)
289     {
290         return this.taxonGroups.add(elementToAdd);
291     }
292 
293     /**
294      * Liste l'ensemble de taxons ayant les mêmes caractéristiques pour le critère pris en compte.
295      * @param elementToRemove TaxonGroup
296      * @return <tt>true</tt> if this collection changed as a result of the
297      *         call
298      */
299     public boolean removeTaxonGroups(TaxonGroup elementToRemove)
300     {
301         return this.taxonGroups.remove(elementToRemove);
302     }
303 
304     private TaxonGroup parentTaxonGroup;
305 
306     /**
307      * Liste l'ensemble de taxons ayant les mêmes caractéristiques pour le critère pris en compte.
308      * @return this.parentTaxonGroup TaxonGroup
309      */
310     public TaxonGroup getParentTaxonGroup()
311     {
312         return this.parentTaxonGroup;
313     }
314 
315     /**
316      * Liste l'ensemble de taxons ayant les mêmes caractéristiques pour le critère pris en compte.
317      * @param parentTaxonGroupIn TaxonGroup
318      */
319     public void setParentTaxonGroup(TaxonGroup parentTaxonGroupIn)
320     {
321         this.parentTaxonGroup = parentTaxonGroupIn;
322     }
323 
324     private Status status;
325 
326     /**
327      * Liste des états possibles d'un objet.
328      * @return this.status Status
329      */
330     public Status getStatus()
331     {
332         return this.status;
333     }
334 
335     /**
336      * Liste des états possibles d'un objet.
337      * @param statusIn Status
338      */
339     public void setStatus(Status statusIn)
340     {
341         this.status = statusIn;
342     }
343 
344     private Collection<TaxonGroupHistoricalRecord> taxonGroupHistoricalRecords = new HashSet<TaxonGroupHistoricalRecord>();
345 
346     /**
347      * Historique de l'évolution des contenus des groupes de taxons
348      * @return this.taxonGroupHistoricalRecords Collection<TaxonGroupHistoricalRecord>
349      */
350     public Collection<TaxonGroupHistoricalRecord> getTaxonGroupHistoricalRecords()
351     {
352         return this.taxonGroupHistoricalRecords;
353     }
354 
355     /**
356      * Historique de l'évolution des contenus des groupes de taxons
357      * @param taxonGroupHistoricalRecordsIn Collection<TaxonGroupHistoricalRecord>
358      */
359     public void setTaxonGroupHistoricalRecords(Collection<TaxonGroupHistoricalRecord> taxonGroupHistoricalRecordsIn)
360     {
361         this.taxonGroupHistoricalRecords = taxonGroupHistoricalRecordsIn;
362     }
363 
364     /**
365      * Historique de l'évolution des contenus des groupes de taxons
366      * @param elementToAdd TaxonGroupHistoricalRecord
367      * @return <tt>true</tt> if this collection changed as a result of the
368      *         call
369      */
370     public boolean addTaxonGroupHistoricalRecords(TaxonGroupHistoricalRecord elementToAdd)
371     {
372         return this.taxonGroupHistoricalRecords.add(elementToAdd);
373     }
374 
375     /**
376      * Historique de l'évolution des contenus des groupes de taxons
377      * @param elementToRemove TaxonGroupHistoricalRecord
378      * @return <tt>true</tt> if this collection changed as a result of the
379      *         call
380      */
381     public boolean removeTaxonGroupHistoricalRecords(TaxonGroupHistoricalRecord elementToRemove)
382     {
383         return this.taxonGroupHistoricalRecords.remove(elementToRemove);
384     }
385 
386     private TaxonGroupType taxonGroupType;
387 
388     /**
389      * Typologie des groupes de taxons
390      * @return this.taxonGroupType TaxonGroupType
391      */
392     public TaxonGroupType getTaxonGroupType()
393     {
394         return this.taxonGroupType;
395     }
396 
397     /**
398      * Typologie des groupes de taxons
399      * @param taxonGroupTypeIn TaxonGroupType
400      */
401     public void setTaxonGroupType(TaxonGroupType taxonGroupTypeIn)
402     {
403         this.taxonGroupType = taxonGroupTypeIn;
404     }
405 
406     private Collection<SandreTaxonGroupExp> sandreTaxonGroupExpIds = new HashSet<SandreTaxonGroupExp>();
407 
408     /**
409      * Groupe de taxons sandre pour les exports de données
410      * @return this.sandreTaxonGroupExpIds Collection<SandreTaxonGroupExp>
411      */
412     public Collection<SandreTaxonGroupExp> getSandreTaxonGroupExpIds()
413     {
414         return this.sandreTaxonGroupExpIds;
415     }
416 
417     /**
418      * Groupe de taxons sandre pour les exports de données
419      * @param sandreTaxonGroupExpIdsIn Collection<SandreTaxonGroupExp>
420      */
421     public void setSandreTaxonGroupExpIds(Collection<SandreTaxonGroupExp> sandreTaxonGroupExpIdsIn)
422     {
423         this.sandreTaxonGroupExpIds = sandreTaxonGroupExpIdsIn;
424     }
425 
426     /**
427      * Groupe de taxons sandre pour les exports de données
428      * @param elementToAdd SandreTaxonGroupExp
429      * @return <tt>true</tt> if this collection changed as a result of the
430      *         call
431      */
432     public boolean addSandreTaxonGroupExpIds(SandreTaxonGroupExp elementToAdd)
433     {
434         return this.sandreTaxonGroupExpIds.add(elementToAdd);
435     }
436 
437     /**
438      * Groupe de taxons sandre pour les exports de données
439      * @param elementToRemove SandreTaxonGroupExp
440      * @return <tt>true</tt> if this collection changed as a result of the
441      *         call
442      */
443     public boolean removeSandreTaxonGroupExpIds(SandreTaxonGroupExp elementToRemove)
444     {
445         return this.sandreTaxonGroupExpIds.remove(elementToRemove);
446     }
447 
448     private Collection<TaxonGroupPosition> taxonGroupPositions = new HashSet<TaxonGroupPosition>();
449 
450     /**
451      * Groupe de taxon en un lieu pour un type de ressource.
452      * @return this.taxonGroupPositions Collection<TaxonGroupPosition>
453      */
454     public Collection<TaxonGroupPosition> getTaxonGroupPositions()
455     {
456         return this.taxonGroupPositions;
457     }
458 
459     /**
460      * Groupe de taxon en un lieu pour un type de ressource.
461      * @param taxonGroupPositionsIn Collection<TaxonGroupPosition>
462      */
463     public void setTaxonGroupPositions(Collection<TaxonGroupPosition> taxonGroupPositionsIn)
464     {
465         this.taxonGroupPositions = taxonGroupPositionsIn;
466     }
467 
468     /**
469      * Groupe de taxon en un lieu pour un type de ressource.
470      * @param elementToAdd TaxonGroupPosition
471      * @return <tt>true</tt> if this collection changed as a result of the
472      *         call
473      */
474     public boolean addTaxonGroupPositions(TaxonGroupPosition elementToAdd)
475     {
476         return this.taxonGroupPositions.add(elementToAdd);
477     }
478 
479     /**
480      * Groupe de taxon en un lieu pour un type de ressource.
481      * @param elementToRemove TaxonGroupPosition
482      * @return <tt>true</tt> if this collection changed as a result of the
483      *         call
484      */
485     public boolean removeTaxonGroupPositions(TaxonGroupPosition elementToRemove)
486     {
487         return this.taxonGroupPositions.remove(elementToRemove);
488     }
489 
490     /**
491      * Returns <code>true</code> if the argument is an TaxonGroup instance and all identifiers for this entity
492      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
493      */
494     @Override
495     public boolean equals(Object object)
496     {
497         if (this == object)
498         {
499             return true;
500         }
501         if (!(object instanceof TaxonGroup))
502         {
503             return false;
504         }
505         final TaxonGroup that = (TaxonGroup)object;
506         if (this.taxonGroupId == null || that.getTaxonGroupId() == null || !this.taxonGroupId.equals(that.getTaxonGroupId()))
507         {
508             return false;
509         }
510         return true;
511     }
512 
513     /**
514      * Returns a hash code based on this entity's identifiers.
515      */
516     @Override
517     public int hashCode()
518     {
519         int hashCode = 0;
520         hashCode = 29 * hashCode + (this.taxonGroupId == null ? 0 : this.taxonGroupId.hashCode());
521 
522         return hashCode;
523     }
524 
525     /**
526      * Constructs new instances of {@link TaxonGroup}.
527      */
528     public static final class Factory
529     {
530         /**
531          * Constructs a new instance of {@link TaxonGroup}.
532          * @return new TaxonGroupImpl()
533          */
534         public static TaxonGroup newInstance()
535         {
536             return new TaxonGroupImpl();
537         }
538 
539         /**
540          * Constructs a new instance of {@link TaxonGroup}, taking all required and/or
541          * read-only properties as arguments, except for identifiers.
542          * @param taxonGroupNm String
543          * @param updateDt Timestamp
544          * @param status Status
545          * @param taxonGroupType TaxonGroupType
546          * @return newInstance
547          */
548         public static TaxonGroup newInstance(String taxonGroupNm, Timestamp updateDt, Status status, TaxonGroupType taxonGroupType)
549         {
550             final TaxonGroup entity = new TaxonGroupImpl();
551             entity.setTaxonGroupNm(taxonGroupNm);
552             entity.setUpdateDt(updateDt);
553             entity.setStatus(status);
554             entity.setTaxonGroupType(taxonGroupType);
555             return entity;
556         }
557 
558         /**
559          * Constructs a new instance of {@link TaxonGroup}, taking all possible properties
560          * (except the identifier(s))as arguments.
561          * @param taxonGroupNm String
562          * @param taxonGroupLb String
563          * @param taxonGroupCm String
564          * @param taxonGroupExclus String
565          * @param taxonGroupUpdate String
566          * @param taxonGroupCreationDt Date
567          * @param updateDt Timestamp
568          * @param sandreTaxonGroupImpIds Collection<SandreTaxonGroupImp>
569          * @param taxonGroups Collection<TaxonGroup>
570          * @param parentTaxonGroup TaxonGroup
571          * @param status Status
572          * @param taxonGroupHistoricalRecords Collection<TaxonGroupHistoricalRecord>
573          * @param taxonGroupType TaxonGroupType
574          * @param sandreTaxonGroupExpIds Collection<SandreTaxonGroupExp>
575          * @param taxonGroupPositions Collection<TaxonGroupPosition>
576          * @return newInstance TaxonGroup
577          */
578         public static TaxonGroup newInstance(String taxonGroupNm, String taxonGroupLb, String taxonGroupCm, String taxonGroupExclus, String taxonGroupUpdate, Date taxonGroupCreationDt, Timestamp updateDt, Collection<SandreTaxonGroupImp> sandreTaxonGroupImpIds, Collection<TaxonGroup> taxonGroups, TaxonGroup parentTaxonGroup, Status status, Collection<TaxonGroupHistoricalRecord> taxonGroupHistoricalRecords, TaxonGroupType taxonGroupType, Collection<SandreTaxonGroupExp> sandreTaxonGroupExpIds, Collection<TaxonGroupPosition> taxonGroupPositions)
579         {
580             final TaxonGroup entity = new TaxonGroupImpl();
581             entity.setTaxonGroupNm(taxonGroupNm);
582             entity.setTaxonGroupLb(taxonGroupLb);
583             entity.setTaxonGroupCm(taxonGroupCm);
584             entity.setTaxonGroupExclus(taxonGroupExclus);
585             entity.setTaxonGroupUpdate(taxonGroupUpdate);
586             entity.setTaxonGroupCreationDt(taxonGroupCreationDt);
587             entity.setUpdateDt(updateDt);
588             entity.setSandreTaxonGroupImpIds(sandreTaxonGroupImpIds);
589             entity.setTaxonGroups(taxonGroups);
590             entity.setParentTaxonGroup(parentTaxonGroup);
591             entity.setStatus(status);
592             entity.setTaxonGroupHistoricalRecords(taxonGroupHistoricalRecords);
593             entity.setTaxonGroupType(taxonGroupType);
594             entity.setSandreTaxonGroupExpIds(sandreTaxonGroupExpIds);
595             entity.setTaxonGroupPositions(taxonGroupPositions);
596             return entity;
597         }
598     }
599 
600     /**
601      * @see Comparable#compareTo
602      */
603     public int compareTo(TaxonGroup o)
604     {
605         int cmp = 0;
606         if (this.getTaxonGroupId() != null)
607         {
608             cmp = this.getTaxonGroupId().compareTo(o.getTaxonGroupId());
609         }
610         else
611         {
612             if (this.getTaxonGroupNm() != null)
613             {
614                 cmp = (cmp != 0 ? cmp : this.getTaxonGroupNm().compareTo(o.getTaxonGroupNm()));
615             }
616             if (this.getTaxonGroupLb() != null)
617             {
618                 cmp = (cmp != 0 ? cmp : this.getTaxonGroupLb().compareTo(o.getTaxonGroupLb()));
619             }
620             if (this.getTaxonGroupCm() != null)
621             {
622                 cmp = (cmp != 0 ? cmp : this.getTaxonGroupCm().compareTo(o.getTaxonGroupCm()));
623             }
624             if (this.getTaxonGroupExclus() != null)
625             {
626                 cmp = (cmp != 0 ? cmp : this.getTaxonGroupExclus().compareTo(o.getTaxonGroupExclus()));
627             }
628             if (this.getTaxonGroupUpdate() != null)
629             {
630                 cmp = (cmp != 0 ? cmp : this.getTaxonGroupUpdate().compareTo(o.getTaxonGroupUpdate()));
631             }
632             if (this.getTaxonGroupCreationDt() != null)
633             {
634                 cmp = (cmp != 0 ? cmp : this.getTaxonGroupCreationDt().compareTo(o.getTaxonGroupCreationDt()));
635             }
636             if (this.getUpdateDt() != null)
637             {
638                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
639             }
640         }
641         return cmp;
642     }
643 // HibernateEntity.vsl merge-point
644 // TaxonGroup.java merge-point
645 }