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.data.aquaculture;
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 fr.ifremer.quadrige2.core.dao.referential.Status;
30 import java.io.Serializable;
31 import java.sql.Timestamp;
32 import java.util.Collection;
33 import java.util.HashSet;
34
35 /**
36 * La ploïdie d'une cellule caractérise le nombre et l'organisation de ses chromosomes
37 */
38 // HibernateEntity.vsl annotations merge-point
39 public abstract class Ploidy
40 implements Serializable, Comparable<Ploidy>
41 {
42 /**
43 * The serial version UID of this class. Needed for serialization.
44 */
45 private static final long serialVersionUID = -8554594946339643580L;
46
47 // Generate 3 attributes
48 private Integer ploidyId;
49
50 /**
51 * Identifiant de la ploïdie
52 * @return this.ploidyId Integer
53 */
54 public Integer getPloidyId()
55 {
56 return this.ploidyId;
57 }
58
59 /**
60 * Identifiant de la ploïdie
61 * @param ploidyIdIn Integer
62 */
63 public void setPloidyId(Integer ploidyIdIn)
64 {
65 this.ploidyId = ploidyIdIn;
66 }
67
68 private String ploidyNm;
69
70 /**
71 * Libellé de la ploïdie
72 * @return this.ploidyNm String
73 */
74 public String getPloidyNm()
75 {
76 return this.ploidyNm;
77 }
78
79 /**
80 * Libellé de la ploïdie
81 * @param ploidyNmIn String
82 */
83 public void setPloidyNm(String ploidyNmIn)
84 {
85 this.ploidyNm = ploidyNmIn;
86 }
87
88 private Timestamp updateDt;
89
90 /**
91 * Date de maj
92 * @return this.updateDt Timestamp
93 */
94 public Timestamp getUpdateDt()
95 {
96 return this.updateDt;
97 }
98
99 /**
100 * Date de maj
101 * @param updateDtIn Timestamp
102 */
103 public void setUpdateDt(Timestamp updateDtIn)
104 {
105 this.updateDt = updateDtIn;
106 }
107
108 // Generate 2 associations
109 private Collection<InitialPopulation> initialPopulations = new HashSet<InitialPopulation>();
110
111 /**
112 * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
113 * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
114 * Cela
115 * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
116 * mollusques, que
117 * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
118 * sur
119 * différents lieux de mesures.
120 * @return this.initialPopulations Collection<InitialPopulation>
121 */
122 public Collection<InitialPopulation> getInitialPopulations()
123 {
124 return this.initialPopulations;
125 }
126
127 /**
128 * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
129 * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
130 * Cela
131 * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
132 * mollusques, que
133 * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
134 * sur
135 * différents lieux de mesures.
136 * @param initialPopulationsIn Collection<InitialPopulation>
137 */
138 public void setInitialPopulations(Collection<InitialPopulation> initialPopulationsIn)
139 {
140 this.initialPopulations = initialPopulationsIn;
141 }
142
143 /**
144 * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
145 * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
146 * Cela
147 * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
148 * mollusques, que
149 * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
150 * sur
151 * différents lieux de mesures.
152 * @param elementToAdd InitialPopulation
153 * @return <tt>true</tt> if this collection changed as a result of the
154 * call
155 */
156 public boolean addInitialPopulations(InitialPopulation elementToAdd)
157 {
158 return this.initialPopulations.add(elementToAdd);
159 }
160
161 /**
162 * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
163 * paramètres sur une même population de mollusques répartis en lots sur le littoral français.
164 * Cela
165 * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de
166 * mollusques, que
167 * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
168 * sur
169 * différents lieux de mesures.
170 * @param elementToRemove InitialPopulation
171 * @return <tt>true</tt> if this collection changed as a result of the
172 * call
173 */
174 public boolean removeInitialPopulations(InitialPopulation elementToRemove)
175 {
176 return this.initialPopulations.remove(elementToRemove);
177 }
178
179 private Status status;
180
181 /**
182 * Liste des états possibles d'un objet.
183 * @return this.status Status
184 */
185 public Status getStatus()
186 {
187 return this.status;
188 }
189
190 /**
191 * Liste des états possibles d'un objet.
192 * @param statusIn Status
193 */
194 public void setStatus(Status statusIn)
195 {
196 this.status = statusIn;
197 }
198
199 /**
200 * Returns <code>true</code> if the argument is an Ploidy instance and all identifiers for this entity
201 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
202 */
203 @Override
204 public boolean equals(Object object)
205 {
206 if (this == object)
207 {
208 return true;
209 }
210 if (!(object instanceof Ploidy))
211 {
212 return false;
213 }
214 final Ploidy that = (Ploidy)object;
215 if (this.ploidyId == null || that.getPloidyId() == null || !this.ploidyId.equals(that.getPloidyId()))
216 {
217 return false;
218 }
219 return true;
220 }
221
222 /**
223 * Returns a hash code based on this entity's identifiers.
224 */
225 @Override
226 public int hashCode()
227 {
228 int hashCode = 0;
229 hashCode = 29 * hashCode + (this.ploidyId == null ? 0 : this.ploidyId.hashCode());
230
231 return hashCode;
232 }
233
234 /**
235 * Constructs new instances of {@link Ploidy}.
236 */
237 public static final class Factory
238 {
239 /**
240 * Constructs a new instance of {@link Ploidy}.
241 * @return new PloidyImpl()
242 */
243 public static Ploidy newInstance()
244 {
245 return new PloidyImpl();
246 }
247
248 /**
249 * Constructs a new instance of {@link Ploidy}, taking all required and/or
250 * read-only properties as arguments, except for identifiers.
251 * @param ploidyNm String
252 * @param updateDt Timestamp
253 * @param status Status
254 * @return newInstance
255 */
256 public static Ploidy newInstance(String ploidyNm, Timestamp updateDt, Status status)
257 {
258 final Ploidy entity = new PloidyImpl();
259 entity.setPloidyNm(ploidyNm);
260 entity.setUpdateDt(updateDt);
261 entity.setStatus(status);
262 return entity;
263 }
264
265 /**
266 * Constructs a new instance of {@link Ploidy}, taking all possible properties
267 * (except the identifier(s))as arguments.
268 * @param ploidyNm String
269 * @param updateDt Timestamp
270 * @param initialPopulations Collection<InitialPopulation>
271 * @param status Status
272 * @return newInstance Ploidy
273 */
274 public static Ploidy newInstance(String ploidyNm, Timestamp updateDt, Collection<InitialPopulation> initialPopulations, Status status)
275 {
276 final Ploidy entity = new PloidyImpl();
277 entity.setPloidyNm(ploidyNm);
278 entity.setUpdateDt(updateDt);
279 entity.setInitialPopulations(initialPopulations);
280 entity.setStatus(status);
281 return entity;
282 }
283 }
284
285 /**
286 * @see Comparable#compareTo
287 */
288 public int compareTo(Ploidy o)
289 {
290 int cmp = 0;
291 if (this.getPloidyId() != null)
292 {
293 cmp = this.getPloidyId().compareTo(o.getPloidyId());
294 }
295 else
296 {
297 if (this.getPloidyNm() != null)
298 {
299 cmp = (cmp != 0 ? cmp : this.getPloidyNm().compareTo(o.getPloidyNm()));
300 }
301 if (this.getUpdateDt() != null)
302 {
303 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
304 }
305 }
306 return cmp;
307 }
308 // HibernateEntity.vsl merge-point
309 // Ploidy.java merge-point
310 }