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 java.io.Serializable;
30  import java.sql.Timestamp;
31  import java.util.Collection;
32  import java.util.Date;
33  import java.util.HashSet;
34  
35  /**
36   * Liste des niveaux systématiques des taxons.
37   */
38  // HibernateEntity.vsl annotations merge-point
39  public abstract class TaxonomicLevel
40      implements Serializable, Comparable<TaxonomicLevel>
41  {
42      /**
43       * The serial version UID of this class. Needed for serialization.
44       */
45      private static final long serialVersionUID = -379581566154259524L;
46  
47      // Generate 7 attributes
48      private String taxLevelCd;
49  
50      /**
51       * Code identifiant de façon unique le niveau
52       * @return this.taxLevelCd String
53       */
54      public String getTaxLevelCd()
55      {
56          return this.taxLevelCd;
57      }
58  
59      /**
60       * Code identifiant de façon unique le niveau
61       * @param taxLevelCdIn String
62       */
63      public void setTaxLevelCd(String taxLevelCdIn)
64      {
65          this.taxLevelCd = taxLevelCdIn;
66      }
67  
68      private Integer taxLevelNb;
69  
70      /**
71       * Numéro du rang taxinomique. décroissant du règne vers l'espèce
72       * Ceci permet de limiter le choix des niveaux fils aux numéros inférieurs
73       * @return this.taxLevelNb Integer
74       */
75      public Integer getTaxLevelNb()
76      {
77          return this.taxLevelNb;
78      }
79  
80      /**
81       * Numéro du rang taxinomique. décroissant du règne vers l'espèce
82       * Ceci permet de limiter le choix des niveaux fils aux numéros inférieurs
83       * @param taxLevelNbIn Integer
84       */
85      public void setTaxLevelNb(Integer taxLevelNbIn)
86      {
87          this.taxLevelNb = taxLevelNbIn;
88      }
89  
90      private String taxLevelNm;
91  
92      /**
93       * Libellé du niveau du taxon
94       * @return this.taxLevelNm String
95       */
96      public String getTaxLevelNm()
97      {
98          return this.taxLevelNm;
99      }
100 
101     /**
102      * Libellé du niveau du taxon
103      * @param taxLevelNmIn String
104      */
105     public void setTaxLevelNm(String taxLevelNmIn)
106     {
107         this.taxLevelNm = taxLevelNmIn;
108     }
109 
110     private String taxLevelLb;
111 
112     /**
113      * Mnémonique du niveau du taxon
114      * @return this.taxLevelLb String
115      */
116     public String getTaxLevelLb()
117     {
118         return this.taxLevelLb;
119     }
120 
121     /**
122      * Mnémonique du niveau du taxon
123      * @param taxLevelLbIn String
124      */
125     public void setTaxLevelLb(String taxLevelLbIn)
126     {
127         this.taxLevelLb = taxLevelLbIn;
128     }
129 
130     private String taxLevelCm;
131 
132     /**
133      * Commentaire décrivant le niveau du taxon
134      * @return this.taxLevelCm String
135      */
136     public String getTaxLevelCm()
137     {
138         return this.taxLevelCm;
139     }
140 
141     /**
142      * Commentaire décrivant le niveau du taxon
143      * @param taxLevelCmIn String
144      */
145     public void setTaxLevelCm(String taxLevelCmIn)
146     {
147         this.taxLevelCm = taxLevelCmIn;
148     }
149 
150     private Date taxLevelCreationDt;
151 
152     /**
153      * Date de création de l'objet
154      * @return this.taxLevelCreationDt Date
155      */
156     public Date getTaxLevelCreationDt()
157     {
158         return this.taxLevelCreationDt;
159     }
160 
161     /**
162      * Date de création de l'objet
163      * @param taxLevelCreationDtIn Date
164      */
165     public void setTaxLevelCreationDt(Date taxLevelCreationDtIn)
166     {
167         this.taxLevelCreationDt = taxLevelCreationDtIn;
168     }
169 
170     private Timestamp updateDt;
171 
172     /**
173      * Date de mise à jour de l'objet
174      * @return this.updateDt Timestamp
175      */
176     public Timestamp getUpdateDt()
177     {
178         return this.updateDt;
179     }
180 
181     /**
182      * Date de mise à jour de l'objet
183      * @param updateDtIn Timestamp
184      */
185     public void setUpdateDt(Timestamp updateDtIn)
186     {
187         this.updateDt = updateDtIn;
188     }
189 
190     // Generate 2 associations
191     private Status status;
192 
193     /**
194      * Liste des états possibles d'un objet.
195      * @return this.status Status
196      */
197     public Status getStatus()
198     {
199         return this.status;
200     }
201 
202     /**
203      * Liste des états possibles d'un objet.
204      * @param statusIn Status
205      */
206     public void setStatus(Status statusIn)
207     {
208         this.status = statusIn;
209     }
210 
211     private Collection<TaxonName> taxonNames = new HashSet<TaxonName>();
212 
213     /**
214      * Liste les taxons (interface avec ERMS)
215      * @return this.taxonNames Collection<TaxonName>
216      */
217     public Collection<TaxonName> getTaxonNames()
218     {
219         return this.taxonNames;
220     }
221 
222     /**
223      * Liste les taxons (interface avec ERMS)
224      * @param taxonNamesIn Collection<TaxonName>
225      */
226     public void setTaxonNames(Collection<TaxonName> taxonNamesIn)
227     {
228         this.taxonNames = taxonNamesIn;
229     }
230 
231     /**
232      * Liste les taxons (interface avec ERMS)
233      * @param elementToAdd TaxonName
234      * @return <tt>true</tt> if this collection changed as a result of the
235      *         call
236      */
237     public boolean addTaxonNames(TaxonName elementToAdd)
238     {
239         return this.taxonNames.add(elementToAdd);
240     }
241 
242     /**
243      * Liste les taxons (interface avec ERMS)
244      * @param elementToRemove TaxonName
245      * @return <tt>true</tt> if this collection changed as a result of the
246      *         call
247      */
248     public boolean removeTaxonNames(TaxonName elementToRemove)
249     {
250         return this.taxonNames.remove(elementToRemove);
251     }
252 
253     /**
254      * Returns <code>true</code> if the argument is an TaxonomicLevel instance and all identifiers for this entity
255      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
256      */
257     @Override
258     public boolean equals(Object object)
259     {
260         if (this == object)
261         {
262             return true;
263         }
264         if (!(object instanceof TaxonomicLevel))
265         {
266             return false;
267         }
268         final TaxonomicLevel that = (TaxonomicLevel)object;
269         if (this.taxLevelCd == null || that.getTaxLevelCd() == null || !this.taxLevelCd.equals(that.getTaxLevelCd()))
270         {
271             return false;
272         }
273         return true;
274     }
275 
276     /**
277      * Returns a hash code based on this entity's identifiers.
278      */
279     @Override
280     public int hashCode()
281     {
282         int hashCode = 0;
283         hashCode = 29 * hashCode + (this.taxLevelCd == null ? 0 : this.taxLevelCd.hashCode());
284 
285         return hashCode;
286     }
287 
288     /**
289      * Constructs new instances of {@link TaxonomicLevel}.
290      */
291     public static final class Factory
292     {
293         /**
294          * Constructs a new instance of {@link TaxonomicLevel}.
295          * @return new TaxonomicLevelImpl()
296          */
297         public static TaxonomicLevel newInstance()
298         {
299             return new TaxonomicLevelImpl();
300         }
301 
302         /**
303          * Constructs a new instance of {@link TaxonomicLevel}, taking all required and/or
304          * read-only properties as arguments, except for identifiers.
305          * @param taxLevelNm String
306          * @param status Status
307          * @return newInstance
308          */
309         public static TaxonomicLevel newInstance(String taxLevelNm, Status status)
310         {
311             final TaxonomicLevel entity = new TaxonomicLevelImpl();
312             entity.setTaxLevelNm(taxLevelNm);
313             entity.setStatus(status);
314             return entity;
315         }
316 
317         /**
318          * Constructs a new instance of {@link TaxonomicLevel}, taking all possible properties
319          * (except the identifier(s))as arguments.
320          * @param taxLevelNb Integer
321          * @param taxLevelNm String
322          * @param taxLevelLb String
323          * @param taxLevelCm String
324          * @param taxLevelCreationDt Date
325          * @param updateDt Timestamp
326          * @param status Status
327          * @param taxonNames Collection<TaxonName>
328          * @return newInstance TaxonomicLevel
329          */
330         public static TaxonomicLevel newInstance(Integer taxLevelNb, String taxLevelNm, String taxLevelLb, String taxLevelCm, Date taxLevelCreationDt, Timestamp updateDt, Status status, Collection<TaxonName> taxonNames)
331         {
332             final TaxonomicLevel entity = new TaxonomicLevelImpl();
333             entity.setTaxLevelNb(taxLevelNb);
334             entity.setTaxLevelNm(taxLevelNm);
335             entity.setTaxLevelLb(taxLevelLb);
336             entity.setTaxLevelCm(taxLevelCm);
337             entity.setTaxLevelCreationDt(taxLevelCreationDt);
338             entity.setUpdateDt(updateDt);
339             entity.setStatus(status);
340             entity.setTaxonNames(taxonNames);
341             return entity;
342         }
343     }
344 
345     /**
346      * @see Comparable#compareTo
347      */
348     public int compareTo(TaxonomicLevel o)
349     {
350         int cmp = 0;
351         if (this.getTaxLevelCd() != null)
352         {
353             cmp = this.getTaxLevelCd().compareTo(o.getTaxLevelCd());
354         }
355         else
356         {
357             if (this.getTaxLevelNb() != null)
358             {
359                 cmp = (cmp != 0 ? cmp : this.getTaxLevelNb().compareTo(o.getTaxLevelNb()));
360             }
361             if (this.getTaxLevelNm() != null)
362             {
363                 cmp = (cmp != 0 ? cmp : this.getTaxLevelNm().compareTo(o.getTaxLevelNm()));
364             }
365             if (this.getTaxLevelLb() != null)
366             {
367                 cmp = (cmp != 0 ? cmp : this.getTaxLevelLb().compareTo(o.getTaxLevelLb()));
368             }
369             if (this.getTaxLevelCm() != null)
370             {
371                 cmp = (cmp != 0 ? cmp : this.getTaxLevelCm().compareTo(o.getTaxLevelCm()));
372             }
373             if (this.getTaxLevelCreationDt() != null)
374             {
375                 cmp = (cmp != 0 ? cmp : this.getTaxLevelCreationDt().compareTo(o.getTaxLevelCreationDt()));
376             }
377             if (this.getUpdateDt() != null)
378             {
379                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
380             }
381         }
382         return cmp;
383     }
384 // HibernateEntity.vsl merge-point
385 // TaxonomicLevel.java merge-point
386 }