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 java.io.Serializable;
29  import java.sql.Timestamp;
30  
31  /**
32   * Contient les correspondances entre les taxons du système et les codes alternatifs des taxons
33   * provenant d'autres sources (autres systèmes, référentiels...)
34   */
35  // HibernateEntity.vsl annotations merge-point
36  public abstract class AlternativeTaxon
37      implements Serializable, Comparable<AlternativeTaxon>
38  {
39      /**
40       * The serial version UID of this class. Needed for serialization.
41       */
42      private static final long serialVersionUID = -1635825773334308653L;
43  
44      // Generate 3 attributes
45      private Integer alternTaxonId;
46  
47      /**
48       * 
49       * @return this.alternTaxonId Integer
50       */
51      public Integer getAlternTaxonId()
52      {
53          return this.alternTaxonId;
54      }
55  
56      /**
57       * 
58       * @param alternTaxonIdIn Integer
59       */
60      public void setAlternTaxonId(Integer alternTaxonIdIn)
61      {
62          this.alternTaxonId = alternTaxonIdIn;
63      }
64  
65      private String alternTaxonCd;
66  
67      /**
68       * Code du taxon dans le système alternatif
69       * @return this.alternTaxonCd String
70       */
71      public String getAlternTaxonCd()
72      {
73          return this.alternTaxonCd;
74      }
75  
76      /**
77       * Code du taxon dans le système alternatif
78       * @param alternTaxonCdIn String
79       */
80      public void setAlternTaxonCd(String alternTaxonCdIn)
81      {
82          this.alternTaxonCd = alternTaxonCdIn;
83      }
84  
85      private Timestamp updateDt;
86  
87      /**
88       * Date de mise à jour de l'objet
89       * @return this.updateDt Timestamp
90       */
91      public Timestamp getUpdateDt()
92      {
93          return this.updateDt;
94      }
95  
96      /**
97       * Date de mise à jour de l'objet
98       * @param updateDtIn Timestamp
99       */
100     public void setUpdateDt(Timestamp updateDtIn)
101     {
102         this.updateDt = updateDtIn;
103     }
104 
105     // Generate 2 associations
106     private AlternativeTaxonOrigin alternativeTaxonOrigin;
107 
108     /**
109      * Contient les différentes sources (origines) des codes alternatifs des taxons (autres
110      * systèmes,
111      * référentiels...)
112      * @return this.alternativeTaxonOrigin AlternativeTaxonOrigin
113      */
114     public AlternativeTaxonOrigin getAlternativeTaxonOrigin()
115     {
116         return this.alternativeTaxonOrigin;
117     }
118 
119     /**
120      * Contient les différentes sources (origines) des codes alternatifs des taxons (autres
121      * systèmes,
122      * référentiels...)
123      * @param alternativeTaxonOriginIn AlternativeTaxonOrigin
124      */
125     public void setAlternativeTaxonOrigin(AlternativeTaxonOrigin alternativeTaxonOriginIn)
126     {
127         this.alternativeTaxonOrigin = alternativeTaxonOriginIn;
128     }
129 
130     private TaxonName taxonName;
131 
132     /**
133      * Liste les taxons (interface avec ERMS)
134      * @return this.taxonName TaxonName
135      */
136     public TaxonName getTaxonName()
137     {
138         return this.taxonName;
139     }
140 
141     /**
142      * Liste les taxons (interface avec ERMS)
143      * @param taxonNameIn TaxonName
144      */
145     public void setTaxonName(TaxonName taxonNameIn)
146     {
147         this.taxonName = taxonNameIn;
148     }
149 
150     /**
151      * Returns <code>true</code> if the argument is an AlternativeTaxon instance and all identifiers for this entity
152      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
153      */
154     @Override
155     public boolean equals(Object object)
156     {
157         if (this == object)
158         {
159             return true;
160         }
161         if (!(object instanceof AlternativeTaxon))
162         {
163             return false;
164         }
165         final AlternativeTaxon that = (AlternativeTaxon)object;
166         if (this.alternTaxonId == null || that.getAlternTaxonId() == null || !this.alternTaxonId.equals(that.getAlternTaxonId()))
167         {
168             return false;
169         }
170         return true;
171     }
172 
173     /**
174      * Returns a hash code based on this entity's identifiers.
175      */
176     @Override
177     public int hashCode()
178     {
179         int hashCode = 0;
180         hashCode = 29 * hashCode + (this.alternTaxonId == null ? 0 : this.alternTaxonId.hashCode());
181 
182         return hashCode;
183     }
184 
185     /**
186      * Constructs new instances of {@link AlternativeTaxon}.
187      */
188     public static final class Factory
189     {
190         /**
191          * Constructs a new instance of {@link AlternativeTaxon}.
192          * @return new AlternativeTaxonImpl()
193          */
194         public static AlternativeTaxon newInstance()
195         {
196             return new AlternativeTaxonImpl();
197         }
198 
199         /**
200          * Constructs a new instance of {@link AlternativeTaxon}, taking all required and/or
201          * read-only properties as arguments, except for identifiers.
202          * @param alternTaxonCd String
203          * @param alternativeTaxonOrigin AlternativeTaxonOrigin
204          * @param taxonName TaxonName
205          * @return newInstance
206          */
207         public static AlternativeTaxon newInstance(String alternTaxonCd, AlternativeTaxonOrigin alternativeTaxonOrigin, TaxonName taxonName)
208         {
209             final AlternativeTaxon entity = new AlternativeTaxonImpl();
210             entity.setAlternTaxonCd(alternTaxonCd);
211             entity.setAlternativeTaxonOrigin(alternativeTaxonOrigin);
212             entity.setTaxonName(taxonName);
213             return entity;
214         }
215 
216         /**
217          * Constructs a new instance of {@link AlternativeTaxon}, taking all possible properties
218          * (except the identifier(s))as arguments.
219          * @param alternTaxonCd String
220          * @param updateDt Timestamp
221          * @param alternativeTaxonOrigin AlternativeTaxonOrigin
222          * @param taxonName TaxonName
223          * @return newInstance AlternativeTaxon
224          */
225         public static AlternativeTaxon newInstance(String alternTaxonCd, Timestamp updateDt, AlternativeTaxonOrigin alternativeTaxonOrigin, TaxonName taxonName)
226         {
227             final AlternativeTaxon entity = new AlternativeTaxonImpl();
228             entity.setAlternTaxonCd(alternTaxonCd);
229             entity.setUpdateDt(updateDt);
230             entity.setAlternativeTaxonOrigin(alternativeTaxonOrigin);
231             entity.setTaxonName(taxonName);
232             return entity;
233         }
234     }
235 
236     /**
237      * @see Comparable#compareTo
238      */
239     public int compareTo(AlternativeTaxon o)
240     {
241         int cmp = 0;
242         if (this.getAlternTaxonId() != null)
243         {
244             cmp = this.getAlternTaxonId().compareTo(o.getAlternTaxonId());
245         }
246         else
247         {
248             if (this.getAlternTaxonCd() != null)
249             {
250                 cmp = (cmp != 0 ? cmp : this.getAlternTaxonCd().compareTo(o.getAlternTaxonCd()));
251             }
252             if (this.getUpdateDt() != null)
253             {
254                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
255             }
256         }
257         return cmp;
258     }
259 // HibernateEntity.vsl merge-point
260 // AlternativeTaxon.java merge-point
261 }