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