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