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.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.referential.Status;
30  import fr.ifremer.quadrige2.core.dao.referential.Unit;
31  import java.io.Serializable;
32  import java.sql.Timestamp;
33  import java.util.Collection;
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 = -8946502882132003441L;
47  
48      // Generate 5 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 Integer 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 Integer
75       */
76      public Integer 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 Integer
85       */
86      public void setPmfmMaximumNumberDecimals(Integer pmfmMaximumNumberDecimalsIn)
87      {
88          this.pmfmMaximumNumberDecimals = pmfmMaximumNumberDecimalsIn;
89      }
90  
91      private Integer pmfmSignifFiguresNumber;
92  
93      /**
94       * Nombre de chiffre significatif des mesures
95       * @return this.pmfmSignifFiguresNumber Integer
96       */
97      public Integer getPmfmSignifFiguresNumber()
98      {
99          return this.pmfmSignifFiguresNumber;
100     }
101 
102     /**
103      * Nombre de chiffre significatif des mesures
104      * @param pmfmSignifFiguresNumberIn Integer
105      */
106     public void setPmfmSignifFiguresNumber(Integer 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     // Generate 12 associations
152     private Unit unit;
153 
154     /**
155      * Liste l'ensemble des unités de mesure.
156      * @return this.unit Unit
157      */
158     public Unit getUnit()
159     {
160         return this.unit;
161     }
162 
163     /**
164      * Liste l'ensemble des unités de mesure.
165      * @param unitIn Unit
166      */
167     public void setUnit(Unit unitIn)
168     {
169         this.unit = unitIn;
170     }
171 
172     private Matrix matrix;
173 
174     /**
175      * Support utilisé pour mesurer un paramètre.
176      * @return this.matrix Matrix
177      */
178     public Matrix getMatrix()
179     {
180         return this.matrix;
181     }
182 
183     /**
184      * Support utilisé pour mesurer un paramètre.
185      * @param matrixIn Matrix
186      */
187     public void setMatrix(Matrix matrixIn)
188     {
189         this.matrix = matrixIn;
190     }
191 
192     private Fraction fraction;
193 
194     /**
195      * Liste les fractions (compléter la description).
196      * @return this.fraction Fraction
197      */
198     public Fraction getFraction()
199     {
200         return this.fraction;
201     }
202 
203     /**
204      * Liste les fractions (compléter la description).
205      * @param fractionIn Fraction
206      */
207     public void setFraction(Fraction fractionIn)
208     {
209         this.fraction = fractionIn;
210     }
211 
212     private Parameter parameter;
213 
214     /**
215      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
216      * @return this.parameter Parameter
217      */
218     public Parameter getParameter()
219     {
220         return this.parameter;
221     }
222 
223     /**
224      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
225      * @param parameterIn Parameter
226      */
227     public void setParameter(Parameter parameterIn)
228     {
229         this.parameter = parameterIn;
230     }
231 
232     private Method method;
233 
234     /**
235      * Méthode utilisée pour mesurer un paramètre.
236      * @return this.method Method
237      */
238     public Method getMethod()
239     {
240         return this.method;
241     }
242 
243     /**
244      * Méthode utilisée pour mesurer un paramètre.
245      * @param methodIn Method
246      */
247     public void setMethod(Method methodIn)
248     {
249         this.method = methodIn;
250     }
251 
252     private Status status;
253 
254     /**
255      * Liste des états possibles d'un objet.
256      * @return this.status Status
257      */
258     public Status getStatus()
259     {
260         return this.status;
261     }
262 
263     /**
264      * Liste des états possibles d'un objet.
265      * @param statusIn Status
266      */
267     public void setStatus(Status statusIn)
268     {
269         this.status = statusIn;
270     }
271 
272     private Collection<PmfmQualValue> pmfmQualValues = new HashSet<PmfmQualValue>();
273 
274     /**
275      * Liste des valeurs qualitatives pour un PSFM.
276      * Sous-liste des valeurs qualitatives d'un paramètre
277      * @return this.pmfmQualValues Collection<PmfmQualValue>
278      */
279     public Collection<PmfmQualValue> getPmfmQualValues()
280     {
281         return this.pmfmQualValues;
282     }
283 
284     /**
285      * Liste des valeurs qualitatives pour un PSFM.
286      * Sous-liste des valeurs qualitatives d'un paramètre
287      * @param pmfmQualValuesIn Collection<PmfmQualValue>
288      */
289     public void setPmfmQualValues(Collection<PmfmQualValue> pmfmQualValuesIn)
290     {
291         this.pmfmQualValues = pmfmQualValuesIn;
292     }
293 
294     /**
295      * Liste des valeurs qualitatives pour un PSFM.
296      * Sous-liste des valeurs qualitatives d'un paramètre
297      * @param elementToAdd PmfmQualValue
298      * @return <tt>true</tt> if this collection changed as a result of the
299      *         call
300      */
301     public boolean addPmfmQualValues(PmfmQualValue elementToAdd)
302     {
303         return this.pmfmQualValues.add(elementToAdd);
304     }
305 
306     /**
307      * Liste des valeurs qualitatives pour un PSFM.
308      * Sous-liste des valeurs qualitatives d'un paramètre
309      * @param elementToRemove PmfmQualValue
310      * @return <tt>true</tt> if this collection changed as a result of the
311      *         call
312      */
313     public boolean removePmfmQualValues(PmfmQualValue elementToRemove)
314     {
315         return this.pmfmQualValues.remove(elementToRemove);
316     }
317 
318     /**
319      * Returns <code>true</code> if the argument is an Pmfm instance and all identifiers for this entity
320      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
321      */
322     @Override
323     public boolean equals(Object object)
324     {
325         if (this == object)
326         {
327             return true;
328         }
329         if (!(object instanceof Pmfm))
330         {
331             return false;
332         }
333         final Pmfm that = (Pmfm)object;
334         if (this.pmfmId == null || that.getPmfmId() == null || !this.pmfmId.equals(that.getPmfmId()))
335         {
336             return false;
337         }
338         return true;
339     }
340 
341     /**
342      * Returns a hash code based on this entity's identifiers.
343      */
344     @Override
345     public int hashCode()
346     {
347         int hashCode = 0;
348         hashCode = 29 * hashCode + (this.pmfmId == null ? 0 : this.pmfmId.hashCode());
349 
350         return hashCode;
351     }
352 
353     /**
354      * Constructs new instances of {@link Pmfm}.
355      */
356     public static final class Factory
357     {
358         /**
359          * Constructs a new instance of {@link Pmfm}.
360          * @return new PmfmImpl()
361          */
362         public static Pmfm newInstance()
363         {
364             return new PmfmImpl();
365         }
366 
367         /**
368          * Constructs a new instance of {@link Pmfm}, taking all required and/or
369          * read-only properties as arguments, except for identifiers.
370          * @param updateDt Timestamp
371          * @param unit Unit
372          * @param matrix Matrix
373          * @param fraction Fraction
374          * @param parameter Parameter
375          * @param method Method
376          * @param status Status
377          * @return newInstance
378          */
379         public static Pmfm newInstance(Timestamp updateDt, Unit unit, Matrix matrix, Fraction fraction, Parameter parameter, Method method, Status status)
380         {
381             final Pmfm entity = new PmfmImpl();
382             entity.setUpdateDt(updateDt);
383             entity.setUnit(unit);
384             entity.setMatrix(matrix);
385             entity.setFraction(fraction);
386             entity.setParameter(parameter);
387             entity.setMethod(method);
388             entity.setStatus(status);
389             return entity;
390         }
391 
392         /**
393          * Constructs a new instance of {@link Pmfm}, taking all possible properties
394          * (except the identifier(s))as arguments.
395          * @param pmfmDetectionThreshold Float
396          * @param pmfmMaximumNumberDecimals Integer
397          * @param pmfmSignifFiguresNumber Integer
398          * @param updateDt Timestamp
399          * @param unit Unit
400          * @param matrix Matrix
401          * @param fraction Fraction
402          * @param parameter Parameter
403          * @param method Method
404          * @param status Status
405          * @param pmfmQualValues Collection<PmfmQualValue>
406          * @return newInstance Pmfm
407          */
408         public static Pmfm newInstance(Float pmfmDetectionThreshold, Integer pmfmMaximumNumberDecimals, Integer pmfmSignifFiguresNumber, Timestamp updateDt, Unit unit, Matrix matrix, Fraction fraction, Parameter parameter, Method method, Status status, Collection<PmfmQualValue> pmfmQualValues)
409         {
410             final Pmfm entity = new PmfmImpl();
411             entity.setPmfmDetectionThreshold(pmfmDetectionThreshold);
412             entity.setPmfmMaximumNumberDecimals(pmfmMaximumNumberDecimals);
413             entity.setPmfmSignifFiguresNumber(pmfmSignifFiguresNumber);
414             entity.setUpdateDt(updateDt);
415             entity.setUnit(unit);
416             entity.setMatrix(matrix);
417             entity.setFraction(fraction);
418             entity.setParameter(parameter);
419             entity.setMethod(method);
420             entity.setStatus(status);
421             entity.setPmfmQualValues(pmfmQualValues);
422             return entity;
423         }
424     }
425 
426     /**
427      * @see Comparable#compareTo
428      */
429     public int compareTo(Pmfm o)
430     {
431         int cmp = 0;
432         if (this.getPmfmId() != null)
433         {
434             cmp = this.getPmfmId().compareTo(o.getPmfmId());
435         }
436         else
437         {
438             if (this.getPmfmDetectionThreshold() != null)
439             {
440                 cmp = (cmp != 0 ? cmp : this.getPmfmDetectionThreshold().compareTo(o.getPmfmDetectionThreshold()));
441             }
442             if (this.getPmfmMaximumNumberDecimals() != null)
443             {
444                 cmp = (cmp != 0 ? cmp : this.getPmfmMaximumNumberDecimals().compareTo(o.getPmfmMaximumNumberDecimals()));
445             }
446             if (this.getPmfmSignifFiguresNumber() != null)
447             {
448                 cmp = (cmp != 0 ? cmp : this.getPmfmSignifFiguresNumber().compareTo(o.getPmfmSignifFiguresNumber()));
449             }
450             if (this.getUpdateDt() != null)
451             {
452                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
453             }
454         }
455         return cmp;
456     }
457 // HibernateEntity.vsl merge-point
458 // Pmfm.java merge-point
459 }