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.administration.strategy;
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.AcquisitionLevel;
30  import fr.ifremer.quadrige2.core.dao.referential.PrecisionType;
31  import fr.ifremer.quadrige2.core.dao.referential.pmfm.Pmfm;
32  import java.io.Serializable;
33  import java.sql.Timestamp;
34  import java.util.Collection;
35  import java.util.HashSet;
36  
37  /**
38   * PSFM associés à une stratégie
39   * PMSF associés à une stratégie.
40   */
41  // HibernateEntity.vsl annotations merge-point
42  public abstract class PmfmStrategy
43      implements Serializable, Comparable<PmfmStrategy>
44  {
45      /**
46       * The serial version UID of this class. Needed for serialization.
47       */
48      private static final long serialVersionUID = 6770525363219752117L;
49  
50      // Generate 6 attributes
51      private Integer pmfmStratId;
52  
53      /**
54       * 
55       * @return this.pmfmStratId Integer
56       */
57      public Integer getPmfmStratId()
58      {
59          return this.pmfmStratId;
60      }
61  
62      /**
63       * 
64       * @param pmfmStratIdIn Integer
65       */
66      public void setPmfmStratId(Integer pmfmStratIdIn)
67      {
68          this.pmfmStratId = pmfmStratIdIn;
69      }
70  
71      private Double pmfmStratParAcquisNumber;
72  
73      /**
74       * Nombre de fois où un paramètre peut être saisi
75       * Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la
76       * valeur 1
77       * @return this.pmfmStratParAcquisNumber Double
78       */
79      public Double getPmfmStratParAcquisNumber()
80      {
81          return this.pmfmStratParAcquisNumber;
82      }
83  
84      /**
85       * Nombre de fois où un paramètre peut être saisi
86       * Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la
87       * valeur 1
88       * @param pmfmStratParAcquisNumberIn Double
89       */
90      public void setPmfmStratParAcquisNumber(Double pmfmStratParAcquisNumberIn)
91      {
92          this.pmfmStratParAcquisNumber = pmfmStratParAcquisNumberIn;
93      }
94  
95      private Integer pmfmStratPresRk;
96  
97      /**
98       * Rang pour la presentation des résultats
99       * @return this.pmfmStratPresRk Integer
100      */
101     public Integer getPmfmStratPresRk()
102     {
103         return this.pmfmStratPresRk;
104     }
105 
106     /**
107      * Rang pour la presentation des résultats
108      * @param pmfmStratPresRkIn Integer
109      */
110     public void setPmfmStratPresRk(Integer pmfmStratPresRkIn)
111     {
112         this.pmfmStratPresRk = pmfmStratPresRkIn;
113     }
114 
115     private String pmfmStratParIsIndiv;
116 
117     /**
118      * Indique si la saisie du paramètre se fait sur des individus
119      * @return this.pmfmStratParIsIndiv String
120      */
121     public String getPmfmStratParIsIndiv()
122     {
123         return this.pmfmStratParIsIndiv;
124     }
125 
126     /**
127      * Indique si la saisie du paramètre se fait sur des individus
128      * @param pmfmStratParIsIndivIn String
129      */
130     public void setPmfmStratParIsIndiv(String pmfmStratParIsIndivIn)
131     {
132         this.pmfmStratParIsIndiv = pmfmStratParIsIndivIn;
133     }
134 
135     private String pmfmStratIsUniqueByTaxon;
136 
137     /**
138      * 
139      * @return this.pmfmStratIsUniqueByTaxon String
140      */
141     public String getPmfmStratIsUniqueByTaxon()
142     {
143         return this.pmfmStratIsUniqueByTaxon;
144     }
145 
146     /**
147      * 
148      * @param pmfmStratIsUniqueByTaxonIn String
149      */
150     public void setPmfmStratIsUniqueByTaxon(String pmfmStratIsUniqueByTaxonIn)
151     {
152         this.pmfmStratIsUniqueByTaxon = pmfmStratIsUniqueByTaxonIn;
153     }
154 
155     private Timestamp updateDt;
156 
157     /**
158      * Date de modification de l'objet, mise à jour par le système
159      * @return this.updateDt Timestamp
160      */
161     public Timestamp getUpdateDt()
162     {
163         return this.updateDt;
164     }
165 
166     /**
167      * Date de modification de l'objet, mise à jour par le système
168      * @param updateDtIn Timestamp
169      */
170     public void setUpdateDt(Timestamp updateDtIn)
171     {
172         this.updateDt = updateDtIn;
173     }
174 
175     // Generate 6 associations
176     private Collection<UiFunction> uiFunctions = new HashSet<UiFunction>();
177 
178     /**
179      * Fonction de calcul affichées lors de la saisie en mode colonne.
180      * Permet de fournir un calcul sur une série de mesure.
181      * Ces calculs ne sont pas stockés et sont là uniquement pour un contrôle lors de la saisie
182      * @return this.uiFunctions Collection<UiFunction>
183      */
184     public Collection<UiFunction> getUiFunctions()
185     {
186         return this.uiFunctions;
187     }
188 
189     /**
190      * Fonction de calcul affichées lors de la saisie en mode colonne.
191      * Permet de fournir un calcul sur une série de mesure.
192      * Ces calculs ne sont pas stockés et sont là uniquement pour un contrôle lors de la saisie
193      * @param uiFunctionsIn Collection<UiFunction>
194      */
195     public void setUiFunctions(Collection<UiFunction> uiFunctionsIn)
196     {
197         this.uiFunctions = uiFunctionsIn;
198     }
199 
200     /**
201      * Fonction de calcul affichées lors de la saisie en mode colonne.
202      * Permet de fournir un calcul sur une série de mesure.
203      * Ces calculs ne sont pas stockés et sont là uniquement pour un contrôle lors de la saisie
204      * @param elementToAdd UiFunction
205      * @return <tt>true</tt> if this collection changed as a result of the
206      *         call
207      */
208     public boolean addUiFunctions(UiFunction elementToAdd)
209     {
210         return this.uiFunctions.add(elementToAdd);
211     }
212 
213     /**
214      * Fonction de calcul affichées lors de la saisie en mode colonne.
215      * Permet de fournir un calcul sur une série de mesure.
216      * Ces calculs ne sont pas stockés et sont là uniquement pour un contrôle lors de la saisie
217      * @param elementToRemove UiFunction
218      * @return <tt>true</tt> if this collection changed as a result of the
219      *         call
220      */
221     public boolean removeUiFunctions(UiFunction elementToRemove)
222     {
223         return this.uiFunctions.remove(elementToRemove);
224     }
225 
226     private Pmfm pmfm;
227 
228     /**
229      * Liste les quadruplets paramètre, méthode, support, fraction.
230      * @return this.pmfm Pmfm
231      */
232     public Pmfm getPmfm()
233     {
234         return this.pmfm;
235     }
236 
237     /**
238      * Liste les quadruplets paramètre, méthode, support, fraction.
239      * @param pmfmIn Pmfm
240      */
241     public void setPmfm(Pmfm pmfmIn)
242     {
243         this.pmfm = pmfmIn;
244     }
245 
246     private PrecisionType precisionType;
247 
248     /**
249      * type d'incertitude des mesures d'un paramètre dans une stratégie.
250      * @return this.precisionType PrecisionType
251      */
252     public PrecisionType getPrecisionType()
253     {
254         return this.precisionType;
255     }
256 
257     /**
258      * type d'incertitude des mesures d'un paramètre dans une stratégie.
259      * @param precisionTypeIn PrecisionType
260      */
261     public void setPrecisionType(PrecisionType precisionTypeIn)
262     {
263         this.precisionType = precisionTypeIn;
264     }
265 
266     private Strategy strategy;
267 
268     /**
269      * Définie les paramètres à mesurer dans un programme particulier.
270      * @return this.strategy Strategy
271      */
272     public Strategy getStrategy()
273     {
274         return this.strategy;
275     }
276 
277     /**
278      * Définie les paramètres à mesurer dans un programme particulier.
279      * @param strategyIn Strategy
280      */
281     public void setStrategy(Strategy strategyIn)
282     {
283         this.strategy = strategyIn;
284     }
285 
286     private Collection<AcquisitionLevel> acquisitionLevels = new HashSet<AcquisitionLevel>();
287 
288     /**
289      * Liste les différents niveau de saisie des résultats (Passage, Prélèvement, échantillon).
290      * @return this.acquisitionLevels Collection<AcquisitionLevel>
291      */
292     public Collection<AcquisitionLevel> getAcquisitionLevels()
293     {
294         return this.acquisitionLevels;
295     }
296 
297     /**
298      * Liste les différents niveau de saisie des résultats (Passage, Prélèvement, échantillon).
299      * @param acquisitionLevelsIn Collection<AcquisitionLevel>
300      */
301     public void setAcquisitionLevels(Collection<AcquisitionLevel> acquisitionLevelsIn)
302     {
303         this.acquisitionLevels = acquisitionLevelsIn;
304     }
305 
306     /**
307      * Liste les différents niveau de saisie des résultats (Passage, Prélèvement, échantillon).
308      * @param elementToAdd AcquisitionLevel
309      * @return <tt>true</tt> if this collection changed as a result of the
310      *         call
311      */
312     public boolean addAcquisitionLevels(AcquisitionLevel elementToAdd)
313     {
314         return this.acquisitionLevels.add(elementToAdd);
315     }
316 
317     /**
318      * Liste les différents niveau de saisie des résultats (Passage, Prélèvement, échantillon).
319      * @param elementToRemove AcquisitionLevel
320      * @return <tt>true</tt> if this collection changed as a result of the
321      *         call
322      */
323     public boolean removeAcquisitionLevels(AcquisitionLevel elementToRemove)
324     {
325         return this.acquisitionLevels.remove(elementToRemove);
326     }
327 
328     /**
329      * Returns <code>true</code> if the argument is an PmfmStrategy instance and all identifiers for this entity
330      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
331      */
332     @Override
333     public boolean equals(Object object)
334     {
335         if (this == object)
336         {
337             return true;
338         }
339         if (!(object instanceof PmfmStrategy))
340         {
341             return false;
342         }
343         final PmfmStrategy that = (PmfmStrategy)object;
344         if (this.pmfmStratId == null || that.getPmfmStratId() == null || !this.pmfmStratId.equals(that.getPmfmStratId()))
345         {
346             return false;
347         }
348         return true;
349     }
350 
351     /**
352      * Returns a hash code based on this entity's identifiers.
353      */
354     @Override
355     public int hashCode()
356     {
357         int hashCode = 0;
358         hashCode = 29 * hashCode + (this.pmfmStratId == null ? 0 : this.pmfmStratId.hashCode());
359 
360         return hashCode;
361     }
362 
363     /**
364      * Constructs new instances of {@link PmfmStrategy}.
365      */
366     public static final class Factory
367     {
368         /**
369          * Constructs a new instance of {@link PmfmStrategy}.
370          * @return new PmfmStrategyImpl()
371          */
372         public static PmfmStrategy newInstance()
373         {
374             return new PmfmStrategyImpl();
375         }
376 
377         /**
378          * Constructs a new instance of {@link PmfmStrategy}, taking all required and/or
379          * read-only properties as arguments, except for identifiers.
380          * @param pmfmStratParAcquisNumber Double
381          * @param updateDt Timestamp
382          * @param pmfm Pmfm
383          * @param strategy Strategy
384          * @return newInstance
385          */
386         public static PmfmStrategy newInstance(Double pmfmStratParAcquisNumber, Timestamp updateDt, Pmfm pmfm, Strategy strategy)
387         {
388             final PmfmStrategy entity = new PmfmStrategyImpl();
389             entity.setPmfmStratParAcquisNumber(pmfmStratParAcquisNumber);
390             entity.setUpdateDt(updateDt);
391             entity.setPmfm(pmfm);
392             entity.setStrategy(strategy);
393             return entity;
394         }
395 
396         /**
397          * Constructs a new instance of {@link PmfmStrategy}, taking all possible properties
398          * (except the identifier(s))as arguments.
399          * @param pmfmStratParAcquisNumber Double
400          * @param pmfmStratPresRk Integer
401          * @param pmfmStratParIsIndiv String
402          * @param pmfmStratIsUniqueByTaxon String
403          * @param updateDt Timestamp
404          * @param uiFunctions Collection<UiFunction>
405          * @param pmfm Pmfm
406          * @param precisionType PrecisionType
407          * @param strategy Strategy
408          * @param acquisitionLevels Collection<AcquisitionLevel>
409          * @return newInstance PmfmStrategy
410          */
411         public static PmfmStrategy newInstance(Double pmfmStratParAcquisNumber, Integer pmfmStratPresRk, String pmfmStratParIsIndiv, String pmfmStratIsUniqueByTaxon, Timestamp updateDt, Collection<UiFunction> uiFunctions, Pmfm pmfm, PrecisionType precisionType, Strategy strategy, Collection<AcquisitionLevel> acquisitionLevels)
412         {
413             final PmfmStrategy entity = new PmfmStrategyImpl();
414             entity.setPmfmStratParAcquisNumber(pmfmStratParAcquisNumber);
415             entity.setPmfmStratPresRk(pmfmStratPresRk);
416             entity.setPmfmStratParIsIndiv(pmfmStratParIsIndiv);
417             entity.setPmfmStratIsUniqueByTaxon(pmfmStratIsUniqueByTaxon);
418             entity.setUpdateDt(updateDt);
419             entity.setUiFunctions(uiFunctions);
420             entity.setPmfm(pmfm);
421             entity.setPrecisionType(precisionType);
422             entity.setStrategy(strategy);
423             entity.setAcquisitionLevels(acquisitionLevels);
424             return entity;
425         }
426     }
427 
428     /**
429      * @see Comparable#compareTo
430      */
431     public int compareTo(PmfmStrategy o)
432     {
433         int cmp = 0;
434         if (this.getPmfmStratId() != null)
435         {
436             cmp = this.getPmfmStratId().compareTo(o.getPmfmStratId());
437         }
438         else
439         {
440             if (this.getPmfmStratParAcquisNumber() != null)
441             {
442                 cmp = (cmp != 0 ? cmp : this.getPmfmStratParAcquisNumber().compareTo(o.getPmfmStratParAcquisNumber()));
443             }
444             if (this.getPmfmStratPresRk() != null)
445             {
446                 cmp = (cmp != 0 ? cmp : this.getPmfmStratPresRk().compareTo(o.getPmfmStratPresRk()));
447             }
448             if (this.getPmfmStratParIsIndiv() != null)
449             {
450                 cmp = (cmp != 0 ? cmp : this.getPmfmStratParIsIndiv().compareTo(o.getPmfmStratParIsIndiv()));
451             }
452             if (this.getPmfmStratIsUniqueByTaxon() != null)
453             {
454                 cmp = (cmp != 0 ? cmp : this.getPmfmStratIsUniqueByTaxon().compareTo(o.getPmfmStratIsUniqueByTaxon()));
455             }
456             if (this.getUpdateDt() != null)
457             {
458                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
459             }
460         }
461         return cmp;
462     }
463 // HibernateEntity.vsl merge-point
464 // PmfmStrategy.java merge-point
465 }