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.pmfm;
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 fr.ifremer.quadrige3.core.dao.referential.Status;
29 import fr.ifremer.quadrige3.core.dao.referential.Unit;
30 import java.io.Serializable;
31 import java.sql.Timestamp;
32 import java.util.Collection;
33 import java.util.Date;
34 import java.util.HashSet;
35
36 /**
37 * Liste les quadruplets paramètre, méthode, support, fraction.
38 */
39 // HibernateEntity.vsl annotations merge-point
40 public abstract class Pmfm
41 implements Serializable, Comparable<Pmfm>
42 {
43 /**
44 * The serial version UID of this class. Needed for serialization.
45 */
46 private static final long serialVersionUID = 7341255652236886596L;
47
48 // Generate 7 attributes
49 private Float pmfmDetectionThreshold;
50
51 /**
52 * Seuil de détection du quadruplet PMSF
53 * @return this.pmfmDetectionThreshold Float
54 */
55 public Float getPmfmDetectionThreshold()
56 {
57 return this.pmfmDetectionThreshold;
58 }
59
60 /**
61 * Seuil de détection du quadruplet PMSF
62 * @param pmfmDetectionThresholdIn Float
63 */
64 public void setPmfmDetectionThreshold(Float pmfmDetectionThresholdIn)
65 {
66 this.pmfmDetectionThreshold = pmfmDetectionThresholdIn;
67 }
68
69 private Short pmfmMaximumNumberDecimals;
70
71 /**
72 * Nombre maximal de décimal des mesures. Indication pour la saisie. Sert à initialiser les
73 * valeurs des résultats.
74 * @return this.pmfmMaximumNumberDecimals Short
75 */
76 public Short getPmfmMaximumNumberDecimals()
77 {
78 return this.pmfmMaximumNumberDecimals;
79 }
80
81 /**
82 * Nombre maximal de décimal des mesures. Indication pour la saisie. Sert à initialiser les
83 * valeurs des résultats.
84 * @param pmfmMaximumNumberDecimalsIn Short
85 */
86 public void setPmfmMaximumNumberDecimals(Short pmfmMaximumNumberDecimalsIn)
87 {
88 this.pmfmMaximumNumberDecimals = pmfmMaximumNumberDecimalsIn;
89 }
90
91 private Short pmfmSignifFiguresNumber;
92
93 /**
94 * Nombre de chiffre significatif des mesures
95 * @return this.pmfmSignifFiguresNumber Short
96 */
97 public Short getPmfmSignifFiguresNumber()
98 {
99 return this.pmfmSignifFiguresNumber;
100 }
101
102 /**
103 * Nombre de chiffre significatif des mesures
104 * @param pmfmSignifFiguresNumberIn Short
105 */
106 public void setPmfmSignifFiguresNumber(Short pmfmSignifFiguresNumberIn)
107 {
108 this.pmfmSignifFiguresNumber = pmfmSignifFiguresNumberIn;
109 }
110
111 private Timestamp updateDt;
112
113 /**
114 * Date de modification de l'objet, mise à jour par le système
115 * @return this.updateDt Timestamp
116 */
117 public Timestamp getUpdateDt()
118 {
119 return this.updateDt;
120 }
121
122 /**
123 * Date de modification de l'objet, mise à jour par le système
124 * @param updateDtIn Timestamp
125 */
126 public void setUpdateDt(Timestamp updateDtIn)
127 {
128 this.updateDt = updateDtIn;
129 }
130
131 private Integer pmfmId;
132
133 /**
134 *
135 * @return this.pmfmId Integer
136 */
137 public Integer getPmfmId()
138 {
139 return this.pmfmId;
140 }
141
142 /**
143 *
144 * @param pmfmIdIn Integer
145 */
146 public void setPmfmId(Integer pmfmIdIn)
147 {
148 this.pmfmId = pmfmIdIn;
149 }
150
151 private String pmfmCm;
152
153 /**
154 *
155 * @return this.pmfmCm String
156 */
157 public String getPmfmCm()
158 {
159 return this.pmfmCm;
160 }
161
162 /**
163 *
164 * @param pmfmCmIn String
165 */
166 public void setPmfmCm(String pmfmCmIn)
167 {
168 this.pmfmCm = pmfmCmIn;
169 }
170
171 private Date creationDt;
172
173 /**
174 *
175 * @return this.creationDt Date
176 */
177 public Date getCreationDt()
178 {
179 return this.creationDt;
180 }
181
182 /**
183 *
184 * @param creationDtIn Date
185 */
186 public void setCreationDt(Date creationDtIn)
187 {
188 this.creationDt = creationDtIn;
189 }
190
191 // Generate 12 associations
192 private Unit unit;
193
194 /**
195 * Liste l'ensemble des unités de mesure.
196 * @return this.unit Unit
197 */
198 public Unit getUnit()
199 {
200 return this.unit;
201 }
202
203 /**
204 * Liste l'ensemble des unités de mesure.
205 * @param unitIn Unit
206 */
207 public void setUnit(Unit unitIn)
208 {
209 this.unit = unitIn;
210 }
211
212 private Matrix matrix;
213
214 /**
215 * Support utilisé pour mesurer un paramètre.
216 * @return this.matrix Matrix
217 */
218 public Matrix getMatrix()
219 {
220 return this.matrix;
221 }
222
223 /**
224 * Support utilisé pour mesurer un paramètre.
225 * @param matrixIn Matrix
226 */
227 public void setMatrix(Matrix matrixIn)
228 {
229 this.matrix = matrixIn;
230 }
231
232 private Fraction fraction;
233
234 /**
235 * Liste les fractions (compléter la description).
236 * @return this.fraction Fraction
237 */
238 public Fraction getFraction()
239 {
240 return this.fraction;
241 }
242
243 /**
244 * Liste les fractions (compléter la description).
245 * @param fractionIn Fraction
246 */
247 public void setFraction(Fraction fractionIn)
248 {
249 this.fraction = fractionIn;
250 }
251
252 private Parameter parameter;
253
254 /**
255 * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
256 * @return this.parameter Parameter
257 */
258 public Parameter getParameter()
259 {
260 return this.parameter;
261 }
262
263 /**
264 * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
265 * @param parameterIn Parameter
266 */
267 public void setParameter(Parameter parameterIn)
268 {
269 this.parameter = parameterIn;
270 }
271
272 private Method method;
273
274 /**
275 * Méthode utilisée pour mesurer un paramètre.
276 * @return this.method Method
277 */
278 public Method getMethod()
279 {
280 return this.method;
281 }
282
283 /**
284 * Méthode utilisée pour mesurer un paramètre.
285 * @param methodIn Method
286 */
287 public void setMethod(Method methodIn)
288 {
289 this.method = methodIn;
290 }
291
292 private Status status;
293
294 /**
295 * Liste des états possibles d'un objet.
296 * @return this.status Status
297 */
298 public Status getStatus()
299 {
300 return this.status;
301 }
302
303 /**
304 * Liste des états possibles d'un objet.
305 * @param statusIn Status
306 */
307 public void setStatus(Status statusIn)
308 {
309 this.status = statusIn;
310 }
311
312 private Collection<PmfmQualValue> pmfmQualValues = new HashSet<PmfmQualValue>();
313
314 /**
315 * Liste des valeurs qualitatives pour un PSFM.
316 * Sous-liste des valeurs qualitatives d'un paramètre
317 * @return this.pmfmQualValues Collection<PmfmQualValue>
318 */
319 public Collection<PmfmQualValue> getPmfmQualValues()
320 {
321 return this.pmfmQualValues;
322 }
323
324 /**
325 * Liste des valeurs qualitatives pour un PSFM.
326 * Sous-liste des valeurs qualitatives d'un paramètre
327 * @param pmfmQualValuesIn Collection<PmfmQualValue>
328 */
329 public void setPmfmQualValues(Collection<PmfmQualValue> pmfmQualValuesIn)
330 {
331 this.pmfmQualValues = pmfmQualValuesIn;
332 }
333
334 /**
335 * Liste des valeurs qualitatives pour un PSFM.
336 * Sous-liste des valeurs qualitatives d'un paramètre
337 * @param elementToAdd PmfmQualValue
338 * @return <tt>true</tt> if this collection changed as a result of the
339 * call
340 */
341 public boolean addPmfmQualValues(PmfmQualValue elementToAdd)
342 {
343 return this.pmfmQualValues.add(elementToAdd);
344 }
345
346 /**
347 * Liste des valeurs qualitatives pour un PSFM.
348 * Sous-liste des valeurs qualitatives d'un paramètre
349 * @param elementToRemove PmfmQualValue
350 * @return <tt>true</tt> if this collection changed as a result of the
351 * call
352 */
353 public boolean removePmfmQualValues(PmfmQualValue elementToRemove)
354 {
355 return this.pmfmQualValues.remove(elementToRemove);
356 }
357
358 /**
359 * Returns <code>true</code> if the argument is an Pmfm instance and all identifiers for this entity
360 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
361 */
362 @Override
363 public boolean equals(Object object)
364 {
365 if (this == object)
366 {
367 return true;
368 }
369 if (!(object instanceof Pmfm))
370 {
371 return false;
372 }
373 final Pmfm that = (Pmfm)object;
374 if (this.pmfmId == null || that.getPmfmId() == null || !this.pmfmId.equals(that.getPmfmId()))
375 {
376 return false;
377 }
378 return true;
379 }
380
381 /**
382 * Returns a hash code based on this entity's identifiers.
383 */
384 @Override
385 public int hashCode()
386 {
387 int hashCode = 0;
388 hashCode = 29 * hashCode + (this.pmfmId == null ? 0 : this.pmfmId.hashCode());
389
390 return hashCode;
391 }
392
393 /**
394 * Constructs new instances of {@link Pmfm}.
395 */
396 public static final class Factory
397 {
398 /**
399 * Constructs a new instance of {@link Pmfm}.
400 * @return new PmfmImpl()
401 */
402 public static Pmfm newInstance()
403 {
404 return new PmfmImpl();
405 }
406
407 /**
408 * Constructs a new instance of {@link Pmfm}, taking all required and/or
409 * read-only properties as arguments, except for identifiers.
410 * @param unit Unit
411 * @param matrix Matrix
412 * @param fraction Fraction
413 * @param parameter Parameter
414 * @param method Method
415 * @param status Status
416 * @return newInstance
417 */
418 public static Pmfm newInstance(Unit unit, Matrix matrix, Fraction fraction, Parameter parameter, Method method, Status status)
419 {
420 final Pmfm entity = new PmfmImpl();
421 entity.setUnit(unit);
422 entity.setMatrix(matrix);
423 entity.setFraction(fraction);
424 entity.setParameter(parameter);
425 entity.setMethod(method);
426 entity.setStatus(status);
427 return entity;
428 }
429
430 /**
431 * Constructs a new instance of {@link Pmfm}, taking all possible properties
432 * (except the identifier(s))as arguments.
433 * @param pmfmDetectionThreshold Float
434 * @param pmfmMaximumNumberDecimals Short
435 * @param pmfmSignifFiguresNumber Short
436 * @param updateDt Timestamp
437 * @param pmfmCm String
438 * @param creationDt Date
439 * @param unit Unit
440 * @param matrix Matrix
441 * @param fraction Fraction
442 * @param parameter Parameter
443 * @param method Method
444 * @param status Status
445 * @param pmfmQualValues Collection<PmfmQualValue>
446 * @return newInstance Pmfm
447 */
448 public static Pmfm newInstance(Float pmfmDetectionThreshold, Short pmfmMaximumNumberDecimals, Short pmfmSignifFiguresNumber, Timestamp updateDt, String pmfmCm, Date creationDt, Unit unit, Matrix matrix, Fraction fraction, Parameter parameter, Method method, Status status, Collection<PmfmQualValue> pmfmQualValues)
449 {
450 final Pmfm entity = new PmfmImpl();
451 entity.setPmfmDetectionThreshold(pmfmDetectionThreshold);
452 entity.setPmfmMaximumNumberDecimals(pmfmMaximumNumberDecimals);
453 entity.setPmfmSignifFiguresNumber(pmfmSignifFiguresNumber);
454 entity.setUpdateDt(updateDt);
455 entity.setPmfmCm(pmfmCm);
456 entity.setCreationDt(creationDt);
457 entity.setUnit(unit);
458 entity.setMatrix(matrix);
459 entity.setFraction(fraction);
460 entity.setParameter(parameter);
461 entity.setMethod(method);
462 entity.setStatus(status);
463 entity.setPmfmQualValues(pmfmQualValues);
464 return entity;
465 }
466 }
467
468 /**
469 * @see Comparable#compareTo
470 */
471 public int compareTo(Pmfm o)
472 {
473 int cmp = 0;
474 if (this.getPmfmId() != null)
475 {
476 cmp = this.getPmfmId().compareTo(o.getPmfmId());
477 }
478 else
479 {
480 if (this.getPmfmDetectionThreshold() != null)
481 {
482 cmp = (cmp != 0 ? cmp : this.getPmfmDetectionThreshold().compareTo(o.getPmfmDetectionThreshold()));
483 }
484 if (this.getPmfmMaximumNumberDecimals() != null)
485 {
486 cmp = (cmp != 0 ? cmp : this.getPmfmMaximumNumberDecimals().compareTo(o.getPmfmMaximumNumberDecimals()));
487 }
488 if (this.getPmfmSignifFiguresNumber() != null)
489 {
490 cmp = (cmp != 0 ? cmp : this.getPmfmSignifFiguresNumber().compareTo(o.getPmfmSignifFiguresNumber()));
491 }
492 if (this.getUpdateDt() != null)
493 {
494 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
495 }
496 if (this.getPmfmCm() != null)
497 {
498 cmp = (cmp != 0 ? cmp : this.getPmfmCm().compareTo(o.getPmfmCm()));
499 }
500 if (this.getCreationDt() != null)
501 {
502 cmp = (cmp != 0 ? cmp : this.getCreationDt().compareTo(o.getCreationDt()));
503 }
504 }
505 return cmp;
506 }
507 // HibernateEntity.vsl merge-point
508 // Pmfm.java merge-point
509 }