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