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;
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.sandre.SandreNumericalPrecisionExp;
30 import fr.ifremer.quadrige2.core.dao.sandre.SandreNumericalPrecisionImp;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33 import java.util.Collection;
34 import java.util.HashSet;
35
36 /**
37 * Liste des précisions numériques.
38 */
39 // HibernateEntity.vsl annotations merge-point
40 public abstract class NumericalPrecision
41 implements Serializable, Comparable<NumericalPrecision>
42 {
43 /**
44 * The serial version UID of this class. Needed for serialization.
45 */
46 private static final long serialVersionUID = -2734219105151414762L;
47
48 // Generate 4 attributes
49 private Integer numPrecId;
50
51 /**
52 * Identifiant interne de la précision
53 * @return this.numPrecId Integer
54 */
55 public Integer getNumPrecId()
56 {
57 return this.numPrecId;
58 }
59
60 /**
61 * Identifiant interne de la précision
62 * @param numPrecIdIn Integer
63 */
64 public void setNumPrecId(Integer numPrecIdIn)
65 {
66 this.numPrecId = numPrecIdIn;
67 }
68
69 private String numPrecNm;
70
71 /**
72 * Libellé court de la précision
73 * @return this.numPrecNm String
74 */
75 public String getNumPrecNm()
76 {
77 return this.numPrecNm;
78 }
79
80 /**
81 * Libellé court de la précision
82 * @param numPrecNmIn String
83 */
84 public void setNumPrecNm(String numPrecNmIn)
85 {
86 this.numPrecNm = numPrecNmIn;
87 }
88
89 private String numPrecDc;
90
91 /**
92 * Decription complète de la précision
93 * @return this.numPrecDc String
94 */
95 public String getNumPrecDc()
96 {
97 return this.numPrecDc;
98 }
99
100 /**
101 * Decription complète de la précision
102 * @param numPrecDcIn String
103 */
104 public void setNumPrecDc(String numPrecDcIn)
105 {
106 this.numPrecDc = numPrecDcIn;
107 }
108
109 private Timestamp updateDt;
110
111 /**
112 * Date de modification de l'objet, mise à jour par le système
113 * @return this.updateDt Timestamp
114 */
115 public Timestamp getUpdateDt()
116 {
117 return this.updateDt;
118 }
119
120 /**
121 * Date de modification de l'objet, mise à jour par le système
122 * @param updateDtIn Timestamp
123 */
124 public void setUpdateDt(Timestamp updateDtIn)
125 {
126 this.updateDt = updateDtIn;
127 }
128
129 // Generate 5 associations
130 private Collection<SandreNumericalPrecisionExp> sandreNumericalPrecisionExpIds = new HashSet<SandreNumericalPrecisionExp>();
131
132 /**
133 * Liste des précisions numériques du sandre pour les exports de données
134 * @return this.sandreNumericalPrecisionExpIds Collection<SandreNumericalPrecisionExp>
135 */
136 public Collection<SandreNumericalPrecisionExp> getSandreNumericalPrecisionExpIds()
137 {
138 return this.sandreNumericalPrecisionExpIds;
139 }
140
141 /**
142 * Liste des précisions numériques du sandre pour les exports de données
143 * @param sandreNumericalPrecisionExpIdsIn Collection<SandreNumericalPrecisionExp>
144 */
145 public void setSandreNumericalPrecisionExpIds(Collection<SandreNumericalPrecisionExp> sandreNumericalPrecisionExpIdsIn)
146 {
147 this.sandreNumericalPrecisionExpIds = sandreNumericalPrecisionExpIdsIn;
148 }
149
150 /**
151 * Liste des précisions numériques du sandre pour les exports de données
152 * @param elementToAdd SandreNumericalPrecisionExp
153 * @return <tt>true</tt> if this collection changed as a result of the
154 * call
155 */
156 public boolean addSandreNumericalPrecisionExpIds(SandreNumericalPrecisionExp elementToAdd)
157 {
158 return this.sandreNumericalPrecisionExpIds.add(elementToAdd);
159 }
160
161 /**
162 * Liste des précisions numériques du sandre pour les exports de données
163 * @param elementToRemove SandreNumericalPrecisionExp
164 * @return <tt>true</tt> if this collection changed as a result of the
165 * call
166 */
167 public boolean removeSandreNumericalPrecisionExpIds(SandreNumericalPrecisionExp elementToRemove)
168 {
169 return this.sandreNumericalPrecisionExpIds.remove(elementToRemove);
170 }
171
172 private Collection<SandreNumericalPrecisionImp> sandreNumericalPrecisionImpIds = new HashSet<SandreNumericalPrecisionImp>();
173
174 /**
175 * Liste des précisions numériques du sandre pour les imports de données
176 * @return this.sandreNumericalPrecisionImpIds Collection<SandreNumericalPrecisionImp>
177 */
178 public Collection<SandreNumericalPrecisionImp> getSandreNumericalPrecisionImpIds()
179 {
180 return this.sandreNumericalPrecisionImpIds;
181 }
182
183 /**
184 * Liste des précisions numériques du sandre pour les imports de données
185 * @param sandreNumericalPrecisionImpIdsIn Collection<SandreNumericalPrecisionImp>
186 */
187 public void setSandreNumericalPrecisionImpIds(Collection<SandreNumericalPrecisionImp> sandreNumericalPrecisionImpIdsIn)
188 {
189 this.sandreNumericalPrecisionImpIds = sandreNumericalPrecisionImpIdsIn;
190 }
191
192 /**
193 * Liste des précisions numériques du sandre pour les imports de données
194 * @param elementToAdd SandreNumericalPrecisionImp
195 * @return <tt>true</tt> if this collection changed as a result of the
196 * call
197 */
198 public boolean addSandreNumericalPrecisionImpIds(SandreNumericalPrecisionImp elementToAdd)
199 {
200 return this.sandreNumericalPrecisionImpIds.add(elementToAdd);
201 }
202
203 /**
204 * Liste des précisions numériques du sandre pour les imports de données
205 * @param elementToRemove SandreNumericalPrecisionImp
206 * @return <tt>true</tt> if this collection changed as a result of the
207 * call
208 */
209 public boolean removeSandreNumericalPrecisionImpIds(SandreNumericalPrecisionImp elementToRemove)
210 {
211 return this.sandreNumericalPrecisionImpIds.remove(elementToRemove);
212 }
213
214 private Status status;
215
216 /**
217 * Liste des états possibles d'un objet.
218 * @return this.status Status
219 */
220 public Status getStatus()
221 {
222 return this.status;
223 }
224
225 /**
226 * Liste des états possibles d'un objet.
227 * @param statusIn Status
228 */
229 public void setStatus(Status statusIn)
230 {
231 this.status = statusIn;
232 }
233
234 /**
235 * Returns <code>true</code> if the argument is an NumericalPrecision instance and all identifiers for this entity
236 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
237 */
238 @Override
239 public boolean equals(Object object)
240 {
241 if (this == object)
242 {
243 return true;
244 }
245 if (!(object instanceof NumericalPrecision))
246 {
247 return false;
248 }
249 final NumericalPrecision that = (NumericalPrecision)object;
250 if (this.numPrecId == null || that.getNumPrecId() == null || !this.numPrecId.equals(that.getNumPrecId()))
251 {
252 return false;
253 }
254 return true;
255 }
256
257 /**
258 * Returns a hash code based on this entity's identifiers.
259 */
260 @Override
261 public int hashCode()
262 {
263 int hashCode = 0;
264 hashCode = 29 * hashCode + (this.numPrecId == null ? 0 : this.numPrecId.hashCode());
265
266 return hashCode;
267 }
268
269 /**
270 * Constructs new instances of {@link NumericalPrecision}.
271 */
272 public static final class Factory
273 {
274 /**
275 * Constructs a new instance of {@link NumericalPrecision}.
276 * @return new NumericalPrecisionImpl()
277 */
278 public static NumericalPrecision newInstance()
279 {
280 return new NumericalPrecisionImpl();
281 }
282
283 /**
284 * Constructs a new instance of {@link NumericalPrecision}, taking all required and/or
285 * read-only properties as arguments, except for identifiers.
286 * @param numPrecNm String
287 * @param updateDt Timestamp
288 * @param status Status
289 * @return newInstance
290 */
291 public static NumericalPrecision newInstance(String numPrecNm, Timestamp updateDt, Status status)
292 {
293 final NumericalPrecision entity = new NumericalPrecisionImpl();
294 entity.setNumPrecNm(numPrecNm);
295 entity.setUpdateDt(updateDt);
296 entity.setStatus(status);
297 return entity;
298 }
299
300 /**
301 * Constructs a new instance of {@link NumericalPrecision}, taking all possible properties
302 * (except the identifier(s))as arguments.
303 * @param numPrecNm String
304 * @param numPrecDc String
305 * @param updateDt Timestamp
306 * @param sandreNumericalPrecisionExpIds Collection<SandreNumericalPrecisionExp>
307 * @param sandreNumericalPrecisionImpIds Collection<SandreNumericalPrecisionImp>
308 * @param status Status
309 * @return newInstance NumericalPrecision
310 */
311 public static NumericalPrecision newInstance(String numPrecNm, String numPrecDc, Timestamp updateDt, Collection<SandreNumericalPrecisionExp> sandreNumericalPrecisionExpIds, Collection<SandreNumericalPrecisionImp> sandreNumericalPrecisionImpIds, Status status)
312 {
313 final NumericalPrecision entity = new NumericalPrecisionImpl();
314 entity.setNumPrecNm(numPrecNm);
315 entity.setNumPrecDc(numPrecDc);
316 entity.setUpdateDt(updateDt);
317 entity.setSandreNumericalPrecisionExpIds(sandreNumericalPrecisionExpIds);
318 entity.setSandreNumericalPrecisionImpIds(sandreNumericalPrecisionImpIds);
319 entity.setStatus(status);
320 return entity;
321 }
322 }
323
324 /**
325 * @see Comparable#compareTo
326 */
327 public int compareTo(NumericalPrecision o)
328 {
329 int cmp = 0;
330 if (this.getNumPrecId() != null)
331 {
332 cmp = this.getNumPrecId().compareTo(o.getNumPrecId());
333 }
334 else
335 {
336 if (this.getNumPrecNm() != null)
337 {
338 cmp = (cmp != 0 ? cmp : this.getNumPrecNm().compareTo(o.getNumPrecNm()));
339 }
340 if (this.getNumPrecDc() != null)
341 {
342 cmp = (cmp != 0 ? cmp : this.getNumPrecDc().compareTo(o.getNumPrecDc()));
343 }
344 if (this.getUpdateDt() != null)
345 {
346 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
347 }
348 }
349 return cmp;
350 }
351 // HibernateEntity.vsl merge-point
352 // NumericalPrecision.java merge-point
353 }