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.data.measurement;
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.administration.program.Program;
29 import fr.ifremer.quadrige3.core.dao.administration.user.Department;
30 import fr.ifremer.quadrige3.core.dao.data.sample.Sample;
31 import fr.ifremer.quadrige3.core.dao.data.samplingoperation.SamplingOperation;
32 import fr.ifremer.quadrige3.core.dao.data.survey.Survey;
33 import fr.ifremer.quadrige3.core.dao.referential.AnalysisInstrument;
34 import fr.ifremer.quadrige3.core.dao.referential.NumericalPrecision;
35 import fr.ifremer.quadrige3.core.dao.referential.ObjectType;
36 import fr.ifremer.quadrige3.core.dao.referential.PrecisionType;
37 import fr.ifremer.quadrige3.core.dao.referential.QualityFlag;
38 import fr.ifremer.quadrige3.core.dao.referential.pmfm.Pmfm;
39 import fr.ifremer.quadrige3.core.dao.referential.pmfm.QualitativeValue;
40 import java.io.Serializable;
41 import java.sql.Timestamp;
42 import java.util.Collection;
43 import java.util.Date;
44 import java.util.HashSet;
45
46 /**
47 * Résultat de mesure faisant l'objet d'une valeur unique.
48 */
49 // HibernateEntity.vsl annotations merge-point
50 public abstract class Measurement
51 implements Serializable, Comparable<Measurement>
52 {
53 /**
54 * The serial version UID of this class. Needed for serialization.
55 */
56 private static final long serialVersionUID = 6583044879310178214L;
57
58 // Generate 13 attributes
59 private Integer measId;
60
61 /**
62 * Identifiant interne du résultat
63 * @return this.measId Integer
64 */
65 public Integer getMeasId()
66 {
67 return this.measId;
68 }
69
70 /**
71 * Identifiant interne du résultat
72 * @param measIdIn Integer
73 */
74 public void setMeasId(Integer measIdIn)
75 {
76 this.measId = measIdIn;
77 }
78
79 private Integer objectId;
80
81 /**
82 * Identifiant interne de donnnée in situ de référence (passage, prélèvement, prélèvement)
83 * @return this.objectId Integer
84 */
85 public Integer getObjectId()
86 {
87 return this.objectId;
88 }
89
90 /**
91 * Identifiant interne de donnnée in situ de référence (passage, prélèvement, prélèvement)
92 * @param objectIdIn Integer
93 */
94 public void setObjectId(Integer objectIdIn)
95 {
96 this.objectId = objectIdIn;
97 }
98
99 private Integer measIndivId;
100
101 /**
102 * Le numéro de l'individu mesuré pour les résultats ayant plusieurs individus
103 * @return this.measIndivId Integer
104 */
105 public Integer getMeasIndivId()
106 {
107 return this.measIndivId;
108 }
109
110 /**
111 * Le numéro de l'individu mesuré pour les résultats ayant plusieurs individus
112 * @param measIndivIdIn Integer
113 */
114 public void setMeasIndivId(Integer measIndivIdIn)
115 {
116 this.measIndivId = measIndivIdIn;
117 }
118
119 private Float measNumerValue;
120
121 /**
122 * La valeur du résultat si elle n'est pas qualitative
123 * @return this.measNumerValue Float
124 */
125 public Float getMeasNumerValue()
126 {
127 return this.measNumerValue;
128 }
129
130 /**
131 * La valeur du résultat si elle n'est pas qualitative
132 * @param measNumerValueIn Float
133 */
134 public void setMeasNumerValue(Float measNumerValueIn)
135 {
136 this.measNumerValue = measNumerValueIn;
137 }
138
139 private Float measPrecisionValue;
140
141 /**
142 * La valeur de l'incertitude. Ex : 2 (%) ou 0,01 (dégrés)
143 * @return this.measPrecisionValue Float
144 */
145 public Float getMeasPrecisionValue()
146 {
147 return this.measPrecisionValue;
148 }
149
150 /**
151 * La valeur de l'incertitude. Ex : 2 (%) ou 0,01 (dégrés)
152 * @param measPrecisionValueIn Float
153 */
154 public void setMeasPrecisionValue(Float measPrecisionValueIn)
155 {
156 this.measPrecisionValue = measPrecisionValueIn;
157 }
158
159 private Integer measDigitNumber;
160
161 /**
162 * Nombre de chiffre après la virgule du résulat. Ex : si on saisit 10.00, il faut conserver 2
163 * comme information
164 * @return this.measDigitNumber Integer
165 */
166 public Integer getMeasDigitNumber()
167 {
168 return this.measDigitNumber;
169 }
170
171 /**
172 * Nombre de chiffre après la virgule du résulat. Ex : si on saisit 10.00, il faut conserver 2
173 * comme information
174 * @param measDigitNumberIn Integer
175 */
176 public void setMeasDigitNumber(Integer measDigitNumberIn)
177 {
178 this.measDigitNumber = measDigitNumberIn;
179 }
180
181 private Date measControlDt;
182
183 /**
184 * Date de contrôle
185 * @return this.measControlDt Date
186 */
187 public Date getMeasControlDt()
188 {
189 return this.measControlDt;
190 }
191
192 /**
193 * Date de contrôle
194 * @param measControlDtIn Date
195 */
196 public void setMeasControlDt(Date measControlDtIn)
197 {
198 this.measControlDt = measControlDtIn;
199 }
200
201 private Date measValidDt;
202
203 /**
204 * Date de validation
205 * @return this.measValidDt Date
206 */
207 public Date getMeasValidDt()
208 {
209 return this.measValidDt;
210 }
211
212 /**
213 * Date de validation
214 * @param measValidDtIn Date
215 */
216 public void setMeasValidDt(Date measValidDtIn)
217 {
218 this.measValidDt = measValidDtIn;
219 }
220
221 private Date measQualifDt;
222
223 /**
224 * Date de la qualification du résultat
225 * @return this.measQualifDt Date
226 */
227 public Date getMeasQualifDt()
228 {
229 return this.measQualifDt;
230 }
231
232 /**
233 * Date de la qualification du résultat
234 * @param measQualifDtIn Date
235 */
236 public void setMeasQualifDt(Date measQualifDtIn)
237 {
238 this.measQualifDt = measQualifDtIn;
239 }
240
241 private String measQualifCm;
242
243 /**
244 * Commentaire sur la qualification du résultat
245 * Un commentaire de qualification est obligatoire si la mesure est douteuse ou mauvaise.
246 * @return this.measQualifCm String
247 */
248 public String getMeasQualifCm()
249 {
250 return this.measQualifCm;
251 }
252
253 /**
254 * Commentaire sur la qualification du résultat
255 * Un commentaire de qualification est obligatoire si la mesure est douteuse ou mauvaise.
256 * @param measQualifCmIn String
257 */
258 public void setMeasQualifCm(String measQualifCmIn)
259 {
260 this.measQualifCm = measQualifCmIn;
261 }
262
263 private String measCm;
264
265 /**
266 * Commentaire sur le résultat de mesure
267 * @return this.measCm String
268 */
269 public String getMeasCm()
270 {
271 return this.measCm;
272 }
273
274 /**
275 * Commentaire sur le résultat de mesure
276 * @param measCmIn String
277 */
278 public void setMeasCm(String measCmIn)
279 {
280 this.measCm = measCmIn;
281 }
282
283 private Timestamp updateDt;
284
285 /**
286 * Date de modification de l'objet, mise à jour par le système
287 * @return this.updateDt Timestamp
288 */
289 public Timestamp getUpdateDt()
290 {
291 return this.updateDt;
292 }
293
294 /**
295 * Date de modification de l'objet, mise à jour par le système
296 * @param updateDtIn Timestamp
297 */
298 public void setUpdateDt(Timestamp updateDtIn)
299 {
300 this.updateDt = updateDtIn;
301 }
302
303 private Integer remoteId;
304
305 /**
306 *
307 * @return this.remoteId Integer
308 */
309 public Integer getRemoteId()
310 {
311 return this.remoteId;
312 }
313
314 /**
315 *
316 * @param remoteIdIn Integer
317 */
318 public void setRemoteId(Integer remoteIdIn)
319 {
320 this.remoteId = remoteIdIn;
321 }
322
323 // Generate 13 associations
324 private Sample sample;
325
326 /**
327 * Liste les échantillons prélevés lors d'un passage sur un lieu de surveillance.
328 * @return this.sample Sample
329 */
330 public Sample getSample()
331 {
332 return this.sample;
333 }
334
335 /**
336 * Liste les échantillons prélevés lors d'un passage sur un lieu de surveillance.
337 * @param sampleIn Sample
338 */
339 public void setSample(Sample sampleIn)
340 {
341 this.sample = sampleIn;
342 }
343
344 private ObjectType objectType;
345
346 /**
347 * Liste des types d'objets qui peuvent être associés à la photo ou à un résultat. Cette liste
348 * ne peut
349 * pas être modifiée par l'utilisateur.
350 * @return this.objectType ObjectType
351 */
352 public ObjectType getObjectType()
353 {
354 return this.objectType;
355 }
356
357 /**
358 * Liste des types d'objets qui peuvent être associés à la photo ou à un résultat. Cette liste
359 * ne peut
360 * pas être modifiée par l'utilisateur.
361 * @param objectTypeIn ObjectType
362 */
363 public void setObjectType(ObjectType objectTypeIn)
364 {
365 this.objectType = objectTypeIn;
366 }
367
368 private Department recorderDepartment;
369
370 /**
371 * Liste les départements ou services auxquels sont rattachés les agents
372 * @return this.recorderDepartment Department
373 */
374 public Department getRecorderDepartment()
375 {
376 return this.recorderDepartment;
377 }
378
379 /**
380 * Liste les départements ou services auxquels sont rattachés les agents
381 * @param recorderDepartmentIn Department
382 */
383 public void setRecorderDepartment(Department recorderDepartmentIn)
384 {
385 this.recorderDepartment = recorderDepartmentIn;
386 }
387
388 private AnalysisInstrument analysisInstrument;
389
390 /**
391 * Liste les engins d'analyse ou de prélèvement (au sens marque/modèle et non numéro de série).
392 * @return this.analysisInstrument AnalysisInstrument
393 */
394 public AnalysisInstrument getAnalysisInstrument()
395 {
396 return this.analysisInstrument;
397 }
398
399 /**
400 * Liste les engins d'analyse ou de prélèvement (au sens marque/modèle et non numéro de série).
401 * @param analysisInstrumentIn AnalysisInstrument
402 */
403 public void setAnalysisInstrument(AnalysisInstrument analysisInstrumentIn)
404 {
405 this.analysisInstrument = analysisInstrumentIn;
406 }
407
408 private Department department;
409
410 /**
411 * Liste les départements ou services auxquels sont rattachés les agents
412 * @return this.department Department
413 */
414 public Department getDepartment()
415 {
416 return this.department;
417 }
418
419 /**
420 * Liste les départements ou services auxquels sont rattachés les agents
421 * @param departmentIn Department
422 */
423 public void setDepartment(Department departmentIn)
424 {
425 this.department = departmentIn;
426 }
427
428 private QualityFlag qualityFlag;
429
430 /**
431 * Liste des niveaux de qualification.
432 * @return this.qualityFlag QualityFlag
433 */
434 public QualityFlag getQualityFlag()
435 {
436 return this.qualityFlag;
437 }
438
439 /**
440 * Liste des niveaux de qualification.
441 * @param qualityFlagIn QualityFlag
442 */
443 public void setQualityFlag(QualityFlag qualityFlagIn)
444 {
445 this.qualityFlag = qualityFlagIn;
446 }
447
448 private Pmfm pmfm;
449
450 /**
451 * Liste les quadruplets paramètre, méthode, support, fraction.
452 * @return this.pmfm Pmfm
453 */
454 public Pmfm getPmfm()
455 {
456 return this.pmfm;
457 }
458
459 /**
460 * Liste les quadruplets paramètre, méthode, support, fraction.
461 * @param pmfmIn Pmfm
462 */
463 public void setPmfm(Pmfm pmfmIn)
464 {
465 this.pmfm = pmfmIn;
466 }
467
468 private PrecisionType precisionType;
469
470 /**
471 * type d'incertitude des mesures d'un paramètre dans une stratégie.
472 * @return this.precisionType PrecisionType
473 */
474 public PrecisionType getPrecisionType()
475 {
476 return this.precisionType;
477 }
478
479 /**
480 * type d'incertitude des mesures d'un paramètre dans une stratégie.
481 * @param precisionTypeIn PrecisionType
482 */
483 public void setPrecisionType(PrecisionType precisionTypeIn)
484 {
485 this.precisionType = precisionTypeIn;
486 }
487
488 private Collection<Program> programs = new HashSet<Program>();
489
490 /**
491 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
492 * @return this.programs Collection<Program>
493 */
494 public Collection<Program> getPrograms()
495 {
496 return this.programs;
497 }
498
499 /**
500 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
501 * @param programsIn Collection<Program>
502 */
503 public void setPrograms(Collection<Program> programsIn)
504 {
505 this.programs = programsIn;
506 }
507
508 /**
509 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
510 * @param elementToAdd Program
511 * @return <tt>true</tt> if this collection changed as a result of the
512 * call
513 */
514 public boolean addPrograms(Program elementToAdd)
515 {
516 return this.programs.add(elementToAdd);
517 }
518
519 /**
520 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
521 * @param elementToRemove Program
522 * @return <tt>true</tt> if this collection changed as a result of the
523 * call
524 */
525 public boolean removePrograms(Program elementToRemove)
526 {
527 return this.programs.remove(elementToRemove);
528 }
529
530 private NumericalPrecision numericalPrecision;
531
532 /**
533 * Liste des précisions numériques.
534 * @return this.numericalPrecision NumericalPrecision
535 */
536 public NumericalPrecision getNumericalPrecision()
537 {
538 return this.numericalPrecision;
539 }
540
541 /**
542 * Liste des précisions numériques.
543 * @param numericalPrecisionIn NumericalPrecision
544 */
545 public void setNumericalPrecision(NumericalPrecision numericalPrecisionIn)
546 {
547 this.numericalPrecision = numericalPrecisionIn;
548 }
549
550 private QualitativeValue qualitativeValue;
551
552 /**
553 * Liste des valeurs qualitatives associées aux paramètres.
554 * @return this.qualitativeValue QualitativeValue
555 */
556 public QualitativeValue getQualitativeValue()
557 {
558 return this.qualitativeValue;
559 }
560
561 /**
562 * Liste des valeurs qualitatives associées aux paramètres.
563 * @param qualitativeValueIn QualitativeValue
564 */
565 public void setQualitativeValue(QualitativeValue qualitativeValueIn)
566 {
567 this.qualitativeValue = qualitativeValueIn;
568 }
569
570 private Survey survey;
571
572 /**
573 * Liste les différents passages effectués sur un lieu de surveillance.
574 * Liste les différents passages effectués sur un lieu de surveillance.
575 * @return this.survey Survey
576 */
577 public Survey getSurvey()
578 {
579 return this.survey;
580 }
581
582 /**
583 * Liste les différents passages effectués sur un lieu de surveillance.
584 * Liste les différents passages effectués sur un lieu de surveillance.
585 * @param surveyIn Survey
586 */
587 public void setSurvey(Survey surveyIn)
588 {
589 this.survey = surveyIn;
590 }
591
592 private SamplingOperation samplingOperation;
593
594 /**
595 * Liste les prélévements effectués lors d'un passage.
596 * @return this.samplingOperation SamplingOperation
597 */
598 public SamplingOperation getSamplingOperation()
599 {
600 return this.samplingOperation;
601 }
602
603 /**
604 * Liste les prélévements effectués lors d'un passage.
605 * @param samplingOperationIn SamplingOperation
606 */
607 public void setSamplingOperation(SamplingOperation samplingOperationIn)
608 {
609 this.samplingOperation = samplingOperationIn;
610 }
611
612 /**
613 * Returns <code>true</code> if the argument is an Measurement instance and all identifiers for this entity
614 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
615 */
616 @Override
617 public boolean equals(Object object)
618 {
619 if (this == object)
620 {
621 return true;
622 }
623 if (!(object instanceof Measurement))
624 {
625 return false;
626 }
627 final Measurement that = (Measurement)object;
628 if (this.measId == null || that.getMeasId() == null || !this.measId.equals(that.getMeasId()))
629 {
630 return false;
631 }
632 return true;
633 }
634
635 /**
636 * Returns a hash code based on this entity's identifiers.
637 */
638 @Override
639 public int hashCode()
640 {
641 int hashCode = 0;
642 hashCode = 29 * hashCode + (this.measId == null ? 0 : this.measId.hashCode());
643
644 return hashCode;
645 }
646
647 /**
648 * Constructs new instances of {@link Measurement}.
649 */
650 public static final class Factory
651 {
652 /**
653 * Constructs a new instance of {@link Measurement}.
654 * @return new MeasurementImpl()
655 */
656 public static Measurement newInstance()
657 {
658 return new MeasurementImpl();
659 }
660
661 /**
662 * Constructs a new instance of {@link Measurement}, taking all required and/or
663 * read-only properties as arguments, except for identifiers.
664 * @param objectId Integer
665 * @param objectType ObjectType
666 * @param qualityFlag QualityFlag
667 * @param pmfm Pmfm
668 * @return newInstance
669 */
670 public static Measurement newInstance(Integer objectId, ObjectType objectType, QualityFlag qualityFlag, Pmfm pmfm)
671 {
672 final Measurement entity = new MeasurementImpl();
673 entity.setObjectId(objectId);
674 entity.setObjectType(objectType);
675 entity.setQualityFlag(qualityFlag);
676 entity.setPmfm(pmfm);
677 return entity;
678 }
679
680 /**
681 * Constructs a new instance of {@link Measurement}, taking all possible properties
682 * (except the identifier(s))as arguments.
683 * @param objectId Integer
684 * @param measIndivId Integer
685 * @param measNumerValue Float
686 * @param measPrecisionValue Float
687 * @param measDigitNumber Integer
688 * @param measControlDt Date
689 * @param measValidDt Date
690 * @param measQualifDt Date
691 * @param measQualifCm String
692 * @param measCm String
693 * @param updateDt Timestamp
694 * @param remoteId Integer
695 * @param sample Sample
696 * @param objectType ObjectType
697 * @param recorderDepartment Department
698 * @param analysisInstrument AnalysisInstrument
699 * @param department Department
700 * @param qualityFlag QualityFlag
701 * @param pmfm Pmfm
702 * @param precisionType PrecisionType
703 * @param programs Collection<Program>
704 * @param numericalPrecision NumericalPrecision
705 * @param qualitativeValue QualitativeValue
706 * @param survey Survey
707 * @param samplingOperation SamplingOperation
708 * @return newInstance Measurement
709 */
710 public static Measurement newInstance(Integer objectId, Integer measIndivId, Float measNumerValue, Float measPrecisionValue, Integer measDigitNumber, Date measControlDt, Date measValidDt, Date measQualifDt, String measQualifCm, String measCm, Timestamp updateDt, Integer remoteId, Sample sample, ObjectType objectType, Department recorderDepartment, AnalysisInstrument analysisInstrument, Department department, QualityFlag qualityFlag, Pmfm pmfm, PrecisionType precisionType, Collection<Program> programs, NumericalPrecision numericalPrecision, QualitativeValue qualitativeValue, Survey survey, SamplingOperation samplingOperation)
711 {
712 final Measurement entity = new MeasurementImpl();
713 entity.setObjectId(objectId);
714 entity.setMeasIndivId(measIndivId);
715 entity.setMeasNumerValue(measNumerValue);
716 entity.setMeasPrecisionValue(measPrecisionValue);
717 entity.setMeasDigitNumber(measDigitNumber);
718 entity.setMeasControlDt(measControlDt);
719 entity.setMeasValidDt(measValidDt);
720 entity.setMeasQualifDt(measQualifDt);
721 entity.setMeasQualifCm(measQualifCm);
722 entity.setMeasCm(measCm);
723 entity.setUpdateDt(updateDt);
724 entity.setRemoteId(remoteId);
725 entity.setSample(sample);
726 entity.setObjectType(objectType);
727 entity.setRecorderDepartment(recorderDepartment);
728 entity.setAnalysisInstrument(analysisInstrument);
729 entity.setDepartment(department);
730 entity.setQualityFlag(qualityFlag);
731 entity.setPmfm(pmfm);
732 entity.setPrecisionType(precisionType);
733 entity.setPrograms(programs);
734 entity.setNumericalPrecision(numericalPrecision);
735 entity.setQualitativeValue(qualitativeValue);
736 entity.setSurvey(survey);
737 entity.setSamplingOperation(samplingOperation);
738 return entity;
739 }
740 }
741
742 /**
743 * @see Comparable#compareTo
744 */
745 public int compareTo(Measurement o)
746 {
747 int cmp = 0;
748 if (this.getMeasId() != null)
749 {
750 cmp = this.getMeasId().compareTo(o.getMeasId());
751 }
752 else
753 {
754 if (this.getObjectId() != null)
755 {
756 cmp = (cmp != 0 ? cmp : this.getObjectId().compareTo(o.getObjectId()));
757 }
758 if (this.getMeasIndivId() != null)
759 {
760 cmp = (cmp != 0 ? cmp : this.getMeasIndivId().compareTo(o.getMeasIndivId()));
761 }
762 if (this.getMeasNumerValue() != null)
763 {
764 cmp = (cmp != 0 ? cmp : this.getMeasNumerValue().compareTo(o.getMeasNumerValue()));
765 }
766 if (this.getMeasPrecisionValue() != null)
767 {
768 cmp = (cmp != 0 ? cmp : this.getMeasPrecisionValue().compareTo(o.getMeasPrecisionValue()));
769 }
770 if (this.getMeasDigitNumber() != null)
771 {
772 cmp = (cmp != 0 ? cmp : this.getMeasDigitNumber().compareTo(o.getMeasDigitNumber()));
773 }
774 if (this.getMeasControlDt() != null)
775 {
776 cmp = (cmp != 0 ? cmp : this.getMeasControlDt().compareTo(o.getMeasControlDt()));
777 }
778 if (this.getMeasValidDt() != null)
779 {
780 cmp = (cmp != 0 ? cmp : this.getMeasValidDt().compareTo(o.getMeasValidDt()));
781 }
782 if (this.getMeasQualifDt() != null)
783 {
784 cmp = (cmp != 0 ? cmp : this.getMeasQualifDt().compareTo(o.getMeasQualifDt()));
785 }
786 if (this.getMeasQualifCm() != null)
787 {
788 cmp = (cmp != 0 ? cmp : this.getMeasQualifCm().compareTo(o.getMeasQualifCm()));
789 }
790 if (this.getMeasCm() != null)
791 {
792 cmp = (cmp != 0 ? cmp : this.getMeasCm().compareTo(o.getMeasCm()));
793 }
794 if (this.getUpdateDt() != null)
795 {
796 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
797 }
798 if (this.getRemoteId() != null)
799 {
800 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
801 }
802 }
803 return cmp;
804 }
805 // HibernateEntity.vsl merge-point
806 // Measurement.java merge-point
807 }