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