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