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.pmfm;
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.administration.program.PmfmMor;
30 import fr.ifremer.quadrige2.core.dao.referential.Status;
31 import fr.ifremer.quadrige2.core.dao.sandre.SandreParameterExp;
32 import fr.ifremer.quadrige2.core.dao.sandre.SandreParameterImp;
33 import fr.ifremer.quadrige2.core.dao.system.ComputeFunction;
34 import java.io.Serializable;
35 import java.sql.Timestamp;
36 import java.util.Collection;
37 import java.util.Date;
38 import java.util.HashSet;
39
40 /**
41 * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
42 */
43 // HibernateEntity.vsl annotations merge-point
44 public abstract class Parameter
45 implements Serializable, Comparable<Parameter>
46 {
47 /**
48 * The serial version UID of this class. Needed for serialization.
49 */
50 private static final long serialVersionUID = -8905351031329538785L;
51
52 // Generate 8 attributes
53 private String parCd;
54
55 /**
56 * Code du paramètre
57 * @return this.parCd String
58 */
59 public String getParCd()
60 {
61 return this.parCd;
62 }
63
64 /**
65 * Code du paramètre
66 * @param parCdIn String
67 */
68 public void setParCd(String parCdIn)
69 {
70 this.parCd = parCdIn;
71 }
72
73 private String parNm;
74
75 /**
76 * Libellé du paramètre
77 * @return this.parNm String
78 */
79 public String getParNm()
80 {
81 return this.parNm;
82 }
83
84 /**
85 * Libellé du paramètre
86 * @param parNmIn String
87 */
88 public void setParNm(String parNmIn)
89 {
90 this.parNm = parNmIn;
91 }
92
93 private String parDc;
94
95 /**
96 * Description du paramètre
97 * @return this.parDc String
98 */
99 public String getParDc()
100 {
101 return this.parDc;
102 }
103
104 /**
105 * Description du paramètre
106 * @param parDcIn String
107 */
108 public void setParDc(String parDcIn)
109 {
110 this.parDc = parDcIn;
111 }
112
113 private String parIsQualitative;
114
115 /**
116 * Indique si pour le paramètre on saisit des valeurs numérique ou si on choisit dans une liste
117 * de valeurs qualitatives
118 * @return this.parIsQualitative String
119 */
120 public String getParIsQualitative()
121 {
122 return this.parIsQualitative;
123 }
124
125 /**
126 * Indique si pour le paramètre on saisit des valeurs numérique ou si on choisit dans une liste
127 * de valeurs qualitatives
128 * @param parIsQualitativeIn String
129 */
130 public void setParIsQualitative(String parIsQualitativeIn)
131 {
132 this.parIsQualitative = parIsQualitativeIn;
133 }
134
135 private String parIsCalculated;
136
137 /**
138 * Indique si le paramètre est calculé
139 * @return this.parIsCalculated String
140 */
141 public String getParIsCalculated()
142 {
143 return this.parIsCalculated;
144 }
145
146 /**
147 * Indique si le paramètre est calculé
148 * @param parIsCalculatedIn String
149 */
150 public void setParIsCalculated(String parIsCalculatedIn)
151 {
152 this.parIsCalculated = parIsCalculatedIn;
153 }
154
155 private String parIsTaxonomic;
156
157 /**
158 * Indique si le paramètre est utilisé pour des mesures de dénombrement
159 * @return this.parIsTaxonomic String
160 */
161 public String getParIsTaxonomic()
162 {
163 return this.parIsTaxonomic;
164 }
165
166 /**
167 * Indique si le paramètre est utilisé pour des mesures de dénombrement
168 * @param parIsTaxonomicIn String
169 */
170 public void setParIsTaxonomic(String parIsTaxonomicIn)
171 {
172 this.parIsTaxonomic = parIsTaxonomicIn;
173 }
174
175 private Date parCreationDt;
176
177 /**
178 * Date de création
179 * @return this.parCreationDt Date
180 */
181 public Date getParCreationDt()
182 {
183 return this.parCreationDt;
184 }
185
186 /**
187 * Date de création
188 * @param parCreationDtIn Date
189 */
190 public void setParCreationDt(Date parCreationDtIn)
191 {
192 this.parCreationDt = parCreationDtIn;
193 }
194
195 private Timestamp updateDt;
196
197 /**
198 * Date de maj
199 * @return this.updateDt Timestamp
200 */
201 public Timestamp getUpdateDt()
202 {
203 return this.updateDt;
204 }
205
206 /**
207 * Date de maj
208 * @param updateDtIn Timestamp
209 */
210 public void setUpdateDt(Timestamp updateDtIn)
211 {
212 this.updateDt = updateDtIn;
213 }
214
215 // Generate 10 associations
216 private Collection<SandreParameterExp> sandreParameterExpIds = new HashSet<SandreParameterExp>();
217
218 /**
219 * Paramètre sandre pour les exports de données
220 * @return this.sandreParameterExpIds Collection<SandreParameterExp>
221 */
222 public Collection<SandreParameterExp> getSandreParameterExpIds()
223 {
224 return this.sandreParameterExpIds;
225 }
226
227 /**
228 * Paramètre sandre pour les exports de données
229 * @param sandreParameterExpIdsIn Collection<SandreParameterExp>
230 */
231 public void setSandreParameterExpIds(Collection<SandreParameterExp> sandreParameterExpIdsIn)
232 {
233 this.sandreParameterExpIds = sandreParameterExpIdsIn;
234 }
235
236 /**
237 * Paramètre sandre pour les exports de données
238 * @param elementToAdd SandreParameterExp
239 * @return <tt>true</tt> if this collection changed as a result of the
240 * call
241 */
242 public boolean addSandreParameterExpIds(SandreParameterExp elementToAdd)
243 {
244 return this.sandreParameterExpIds.add(elementToAdd);
245 }
246
247 /**
248 * Paramètre sandre pour les exports de données
249 * @param elementToRemove SandreParameterExp
250 * @return <tt>true</tt> if this collection changed as a result of the
251 * call
252 */
253 public boolean removeSandreParameterExpIds(SandreParameterExp elementToRemove)
254 {
255 return this.sandreParameterExpIds.remove(elementToRemove);
256 }
257
258 private Collection<QualitativeValue> qualitativeValues = new HashSet<QualitativeValue>();
259
260 /**
261 * Liste des valeurs qualitatives associées aux paramètres.
262 * @return this.qualitativeValues Collection<QualitativeValue>
263 */
264 public Collection<QualitativeValue> getQualitativeValues()
265 {
266 return this.qualitativeValues;
267 }
268
269 /**
270 * Liste des valeurs qualitatives associées aux paramètres.
271 * @param qualitativeValuesIn Collection<QualitativeValue>
272 */
273 public void setQualitativeValues(Collection<QualitativeValue> qualitativeValuesIn)
274 {
275 this.qualitativeValues = qualitativeValuesIn;
276 }
277
278 /**
279 * Liste des valeurs qualitatives associées aux paramètres.
280 * @param elementToAdd QualitativeValue
281 * @return <tt>true</tt> if this collection changed as a result of the
282 * call
283 */
284 public boolean addQualitativeValues(QualitativeValue elementToAdd)
285 {
286 return this.qualitativeValues.add(elementToAdd);
287 }
288
289 /**
290 * Liste des valeurs qualitatives associées aux paramètres.
291 * @param elementToRemove QualitativeValue
292 * @return <tt>true</tt> if this collection changed as a result of the
293 * call
294 */
295 public boolean removeQualitativeValues(QualitativeValue elementToRemove)
296 {
297 return this.qualitativeValues.remove(elementToRemove);
298 }
299
300 private Collection<SandreParameterImp> sandreParameterImpIds = new HashSet<SandreParameterImp>();
301
302 /**
303 * Paramètre sandre pour les imports de données
304 * @return this.sandreParameterImpIds Collection<SandreParameterImp>
305 */
306 public Collection<SandreParameterImp> getSandreParameterImpIds()
307 {
308 return this.sandreParameterImpIds;
309 }
310
311 /**
312 * Paramètre sandre pour les imports de données
313 * @param sandreParameterImpIdsIn Collection<SandreParameterImp>
314 */
315 public void setSandreParameterImpIds(Collection<SandreParameterImp> sandreParameterImpIdsIn)
316 {
317 this.sandreParameterImpIds = sandreParameterImpIdsIn;
318 }
319
320 /**
321 * Paramètre sandre pour les imports de données
322 * @param elementToAdd SandreParameterImp
323 * @return <tt>true</tt> if this collection changed as a result of the
324 * call
325 */
326 public boolean addSandreParameterImpIds(SandreParameterImp elementToAdd)
327 {
328 return this.sandreParameterImpIds.add(elementToAdd);
329 }
330
331 /**
332 * Paramètre sandre pour les imports de données
333 * @param elementToRemove SandreParameterImp
334 * @return <tt>true</tt> if this collection changed as a result of the
335 * call
336 */
337 public boolean removeSandreParameterImpIds(SandreParameterImp elementToRemove)
338 {
339 return this.sandreParameterImpIds.remove(elementToRemove);
340 }
341
342 private Status status;
343
344 /**
345 * Liste des états possibles d'un objet.
346 * @return this.status Status
347 */
348 public Status getStatus()
349 {
350 return this.status;
351 }
352
353 /**
354 * Liste des états possibles d'un objet.
355 * @param statusIn Status
356 */
357 public void setStatus(Status statusIn)
358 {
359 this.status = statusIn;
360 }
361
362 private ParameterGroup parGroupId;
363
364 /**
365 * Liste des groupes de paramètres.
366 * @return this.parGroupId ParameterGroup
367 */
368 public ParameterGroup getParGroupId()
369 {
370 return this.parGroupId;
371 }
372
373 /**
374 * Liste des groupes de paramètres.
375 * @param parGroupIdIn ParameterGroup
376 */
377 public void setParGroupId(ParameterGroup parGroupIdIn)
378 {
379 this.parGroupId = parGroupIdIn;
380 }
381
382 private Collection<PmfmMor> pmfmMors = new HashSet<PmfmMor>();
383
384 /**
385 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
386 * @return this.pmfmMors Collection<PmfmMor>
387 */
388 public Collection<PmfmMor> getPmfmMors()
389 {
390 return this.pmfmMors;
391 }
392
393 /**
394 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
395 * @param pmfmMorsIn Collection<PmfmMor>
396 */
397 public void setPmfmMors(Collection<PmfmMor> pmfmMorsIn)
398 {
399 this.pmfmMors = pmfmMorsIn;
400 }
401
402 /**
403 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
404 * @param elementToAdd PmfmMor
405 * @return <tt>true</tt> if this collection changed as a result of the
406 * call
407 */
408 public boolean addPmfmMors(PmfmMor elementToAdd)
409 {
410 return this.pmfmMors.add(elementToAdd);
411 }
412
413 /**
414 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
415 * @param elementToRemove PmfmMor
416 * @return <tt>true</tt> if this collection changed as a result of the
417 * call
418 */
419 public boolean removePmfmMors(PmfmMor elementToRemove)
420 {
421 return this.pmfmMors.remove(elementToRemove);
422 }
423
424 private Collection<ComputeFunction> compFunctionCds = new HashSet<ComputeFunction>();
425
426 /**
427 * Contient les différentes fonction de calcul pour les paramètres
428 * @return this.compFunctionCds Collection<ComputeFunction>
429 */
430 public Collection<ComputeFunction> getCompFunctionCds()
431 {
432 return this.compFunctionCds;
433 }
434
435 /**
436 * Contient les différentes fonction de calcul pour les paramètres
437 * @param compFunctionCdsIn Collection<ComputeFunction>
438 */
439 public void setCompFunctionCds(Collection<ComputeFunction> compFunctionCdsIn)
440 {
441 this.compFunctionCds = compFunctionCdsIn;
442 }
443
444 /**
445 * Contient les différentes fonction de calcul pour les paramètres
446 * @param elementToAdd ComputeFunction
447 * @return <tt>true</tt> if this collection changed as a result of the
448 * call
449 */
450 public boolean addCompFunctionCds(ComputeFunction elementToAdd)
451 {
452 return this.compFunctionCds.add(elementToAdd);
453 }
454
455 /**
456 * Contient les différentes fonction de calcul pour les paramètres
457 * @param elementToRemove ComputeFunction
458 * @return <tt>true</tt> if this collection changed as a result of the
459 * call
460 */
461 public boolean removeCompFunctionCds(ComputeFunction elementToRemove)
462 {
463 return this.compFunctionCds.remove(elementToRemove);
464 }
465
466 private Collection<Pmfm> pmfms = new HashSet<Pmfm>();
467
468 /**
469 * Liste les quadruplets paramètre, méthode, support, fraction.
470 * @return this.pmfms Collection<Pmfm>
471 */
472 public Collection<Pmfm> getPmfms()
473 {
474 return this.pmfms;
475 }
476
477 /**
478 * Liste les quadruplets paramètre, méthode, support, fraction.
479 * @param pmfmsIn Collection<Pmfm>
480 */
481 public void setPmfms(Collection<Pmfm> pmfmsIn)
482 {
483 this.pmfms = pmfmsIn;
484 }
485
486 /**
487 * Liste les quadruplets paramètre, méthode, support, fraction.
488 * @param elementToAdd Pmfm
489 * @return <tt>true</tt> if this collection changed as a result of the
490 * call
491 */
492 public boolean addPmfms(Pmfm elementToAdd)
493 {
494 return this.pmfms.add(elementToAdd);
495 }
496
497 /**
498 * Liste les quadruplets paramètre, méthode, support, fraction.
499 * @param elementToRemove Pmfm
500 * @return <tt>true</tt> if this collection changed as a result of the
501 * call
502 */
503 public boolean removePmfms(Pmfm elementToRemove)
504 {
505 return this.pmfms.remove(elementToRemove);
506 }
507
508 /**
509 * Returns <code>true</code> if the argument is an Parameter instance and all identifiers for this entity
510 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
511 */
512 @Override
513 public boolean equals(Object object)
514 {
515 if (this == object)
516 {
517 return true;
518 }
519 if (!(object instanceof Parameter))
520 {
521 return false;
522 }
523 final Parameter that = (Parameter)object;
524 if (this.parCd == null || that.getParCd() == null || !this.parCd.equals(that.getParCd()))
525 {
526 return false;
527 }
528 return true;
529 }
530
531 /**
532 * Returns a hash code based on this entity's identifiers.
533 */
534 @Override
535 public int hashCode()
536 {
537 int hashCode = 0;
538 hashCode = 29 * hashCode + (this.parCd == null ? 0 : this.parCd.hashCode());
539
540 return hashCode;
541 }
542
543 /**
544 * Constructs new instances of {@link Parameter}.
545 */
546 public static final class Factory
547 {
548 /**
549 * Constructs a new instance of {@link Parameter}.
550 * @return new ParameterImpl()
551 */
552 public static Parameter newInstance()
553 {
554 return new ParameterImpl();
555 }
556
557 /**
558 * Constructs a new instance of {@link Parameter}, taking all required and/or
559 * read-only properties as arguments, except for identifiers.
560 * @param updateDt Timestamp
561 * @param status Status
562 * @param parGroupId ParameterGroup
563 * @return newInstance
564 */
565 public static Parameter newInstance(Timestamp updateDt, Status status, ParameterGroup parGroupId)
566 {
567 final Parameter entity = new ParameterImpl();
568 entity.setUpdateDt(updateDt);
569 entity.setStatus(status);
570 entity.setParGroupId(parGroupId);
571 return entity;
572 }
573
574 /**
575 * Constructs a new instance of {@link Parameter}, taking all possible properties
576 * (except the identifier(s))as arguments.
577 * @param parNm String
578 * @param parDc String
579 * @param parIsQualitative String
580 * @param parIsCalculated String
581 * @param parIsTaxonomic String
582 * @param parCreationDt Date
583 * @param updateDt Timestamp
584 * @param sandreParameterExpIds Collection<SandreParameterExp>
585 * @param qualitativeValues Collection<QualitativeValue>
586 * @param sandreParameterImpIds Collection<SandreParameterImp>
587 * @param status Status
588 * @param parGroupId ParameterGroup
589 * @param pmfmMors Collection<PmfmMor>
590 * @param compFunctionCds Collection<ComputeFunction>
591 * @param pmfms Collection<Pmfm>
592 * @return newInstance Parameter
593 */
594 public static Parameter newInstance(String parNm, String parDc, String parIsQualitative, String parIsCalculated, String parIsTaxonomic, Date parCreationDt, Timestamp updateDt, Collection<SandreParameterExp> sandreParameterExpIds, Collection<QualitativeValue> qualitativeValues, Collection<SandreParameterImp> sandreParameterImpIds, Status status, ParameterGroup parGroupId, Collection<PmfmMor> pmfmMors, Collection<ComputeFunction> compFunctionCds, Collection<Pmfm> pmfms)
595 {
596 final Parameter entity = new ParameterImpl();
597 entity.setParNm(parNm);
598 entity.setParDc(parDc);
599 entity.setParIsQualitative(parIsQualitative);
600 entity.setParIsCalculated(parIsCalculated);
601 entity.setParIsTaxonomic(parIsTaxonomic);
602 entity.setParCreationDt(parCreationDt);
603 entity.setUpdateDt(updateDt);
604 entity.setSandreParameterExpIds(sandreParameterExpIds);
605 entity.setQualitativeValues(qualitativeValues);
606 entity.setSandreParameterImpIds(sandreParameterImpIds);
607 entity.setStatus(status);
608 entity.setParGroupId(parGroupId);
609 entity.setPmfmMors(pmfmMors);
610 entity.setCompFunctionCds(compFunctionCds);
611 entity.setPmfms(pmfms);
612 return entity;
613 }
614 }
615
616 /**
617 * @see Comparable#compareTo
618 */
619 public int compareTo(Parameter o)
620 {
621 int cmp = 0;
622 if (this.getParCd() != null)
623 {
624 cmp = this.getParCd().compareTo(o.getParCd());
625 }
626 else
627 {
628 if (this.getParNm() != null)
629 {
630 cmp = (cmp != 0 ? cmp : this.getParNm().compareTo(o.getParNm()));
631 }
632 if (this.getParDc() != null)
633 {
634 cmp = (cmp != 0 ? cmp : this.getParDc().compareTo(o.getParDc()));
635 }
636 if (this.getParIsQualitative() != null)
637 {
638 cmp = (cmp != 0 ? cmp : this.getParIsQualitative().compareTo(o.getParIsQualitative()));
639 }
640 if (this.getParIsCalculated() != null)
641 {
642 cmp = (cmp != 0 ? cmp : this.getParIsCalculated().compareTo(o.getParIsCalculated()));
643 }
644 if (this.getParIsTaxonomic() != null)
645 {
646 cmp = (cmp != 0 ? cmp : this.getParIsTaxonomic().compareTo(o.getParIsTaxonomic()));
647 }
648 if (this.getParCreationDt() != null)
649 {
650 cmp = (cmp != 0 ? cmp : this.getParCreationDt().compareTo(o.getParCreationDt()));
651 }
652 if (this.getUpdateDt() != null)
653 {
654 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
655 }
656 }
657 return cmp;
658 }
659 // HibernateEntity.vsl merge-point
660 // Parameter.java merge-point
661 }