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.administration.metaprogamme;
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.Unit;
29  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Fraction;
30  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Matrix;
31  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Method;
32  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Parameter;
33  import java.io.Serializable;
34  import java.sql.Timestamp;
35  import java.util.Collection;
36  import java.util.HashSet;
37  
38  /**
39   * Liste des PMFM ou éléments constitutifs associés à un programme
40   */
41  // HibernateEntity.vsl annotations merge-point
42  public abstract class PmfmMet
43      implements Serializable, Comparable<PmfmMet>
44  {
45      /**
46       * The serial version UID of this class. Needed for serialization.
47       */
48      private static final long serialVersionUID = -5327519249329437915L;
49  
50      // Generate 2 attributes
51      private Integer pmfmMetId;
52  
53      /**
54       * Identifiant de l'association
55       * @return this.pmfmMetId Integer
56       */
57      public Integer getPmfmMetId()
58      {
59          return this.pmfmMetId;
60      }
61  
62      /**
63       * Identifiant de l'association
64       * @param pmfmMetIdIn Integer
65       */
66      public void setPmfmMetId(Integer pmfmMetIdIn)
67      {
68          this.pmfmMetId = pmfmMetIdIn;
69      }
70  
71      private Timestamp updateDt;
72  
73      /**
74       * Date de modification de l'objet, mise à jour par le système
75       * @return this.updateDt Timestamp
76       */
77      public Timestamp getUpdateDt()
78      {
79          return this.updateDt;
80      }
81  
82      /**
83       * Date de modification de l'objet, mise à jour par le système
84       * @param updateDtIn Timestamp
85       */
86      public void setUpdateDt(Timestamp updateDtIn)
87      {
88          this.updateDt = updateDtIn;
89      }
90  
91      // Generate 7 associations
92      private Unit unit;
93  
94      /**
95       * Liste l'ensemble des unités de mesure.
96       * @return this.unit Unit
97       */
98      public Unit getUnit()
99      {
100         return this.unit;
101     }
102 
103     /**
104      * Liste l'ensemble des unités de mesure.
105      * @param unitIn Unit
106      */
107     public void setUnit(Unit unitIn)
108     {
109         this.unit = unitIn;
110     }
111 
112     private Fraction fraction;
113 
114     /**
115      * Liste les fractions (compléter la description).
116      * @return this.fraction Fraction
117      */
118     public Fraction getFraction()
119     {
120         return this.fraction;
121     }
122 
123     /**
124      * Liste les fractions (compléter la description).
125      * @param fractionIn Fraction
126      */
127     public void setFraction(Fraction fractionIn)
128     {
129         this.fraction = fractionIn;
130     }
131 
132     private Collection<MonLocMet> monLocMets = new HashSet<MonLocMet>();
133 
134     /**
135      * Liste des lieux d'un métaprogramme
136      * @return this.monLocMets Collection<MonLocMet>
137      */
138     public Collection<MonLocMet> getMonLocMets()
139     {
140         return this.monLocMets;
141     }
142 
143     /**
144      * Liste des lieux d'un métaprogramme
145      * @param monLocMetsIn Collection<MonLocMet>
146      */
147     public void setMonLocMets(Collection<MonLocMet> monLocMetsIn)
148     {
149         this.monLocMets = monLocMetsIn;
150     }
151 
152     /**
153      * Liste des lieux d'un métaprogramme
154      * @param elementToAdd MonLocMet
155      * @return <tt>true</tt> if this collection changed as a result of the
156      *         call
157      */
158     public boolean addMonLocMets(MonLocMet elementToAdd)
159     {
160         return this.monLocMets.add(elementToAdd);
161     }
162 
163     /**
164      * Liste des lieux d'un métaprogramme
165      * @param elementToRemove MonLocMet
166      * @return <tt>true</tt> if this collection changed as a result of the
167      *         call
168      */
169     public boolean removeMonLocMets(MonLocMet elementToRemove)
170     {
171         return this.monLocMets.remove(elementToRemove);
172     }
173 
174     private Matrix matrix;
175 
176     /**
177      * Support utilisé pour mesurer un paramètre.
178      * @return this.matrix Matrix
179      */
180     public Matrix getMatrix()
181     {
182         return this.matrix;
183     }
184 
185     /**
186      * Support utilisé pour mesurer un paramètre.
187      * @param matrixIn Matrix
188      */
189     public void setMatrix(Matrix matrixIn)
190     {
191         this.matrix = matrixIn;
192     }
193 
194     private Method method;
195 
196     /**
197      * Méthode utilisée pour mesurer un paramètre.
198      * @return this.method Method
199      */
200     public Method getMethod()
201     {
202         return this.method;
203     }
204 
205     /**
206      * Méthode utilisée pour mesurer un paramètre.
207      * @param methodIn Method
208      */
209     public void setMethod(Method methodIn)
210     {
211         this.method = methodIn;
212     }
213 
214     private Metaprogramme metaprogramme;
215 
216     /**
217      * Programme virtuel (métaprogramme)
218      * @return this.metaprogramme Metaprogramme
219      */
220     public Metaprogramme getMetaprogramme()
221     {
222         return this.metaprogramme;
223     }
224 
225     /**
226      * Programme virtuel (métaprogramme)
227      * @param metaprogrammeIn Metaprogramme
228      */
229     public void setMetaprogramme(Metaprogramme metaprogrammeIn)
230     {
231         this.metaprogramme = metaprogrammeIn;
232     }
233 
234     private Parameter parameter;
235 
236     /**
237      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
238      * @return this.parameter Parameter
239      */
240     public Parameter getParameter()
241     {
242         return this.parameter;
243     }
244 
245     /**
246      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
247      * @param parameterIn Parameter
248      */
249     public void setParameter(Parameter parameterIn)
250     {
251         this.parameter = parameterIn;
252     }
253 
254     /**
255      * Returns <code>true</code> if the argument is an PmfmMet instance and all identifiers for this entity
256      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
257      */
258     @Override
259     public boolean equals(Object object)
260     {
261         if (this == object)
262         {
263             return true;
264         }
265         if (!(object instanceof PmfmMet))
266         {
267             return false;
268         }
269         final PmfmMet that = (PmfmMet)object;
270         if (this.pmfmMetId == null || that.getPmfmMetId() == null || !this.pmfmMetId.equals(that.getPmfmMetId()))
271         {
272             return false;
273         }
274         return true;
275     }
276 
277     /**
278      * Returns a hash code based on this entity's identifiers.
279      */
280     @Override
281     public int hashCode()
282     {
283         int hashCode = 0;
284         hashCode = 29 * hashCode + (this.pmfmMetId == null ? 0 : this.pmfmMetId.hashCode());
285 
286         return hashCode;
287     }
288 
289     /**
290      * Constructs new instances of {@link PmfmMet}.
291      */
292     public static final class Factory
293     {
294         /**
295          * Constructs a new instance of {@link PmfmMet}.
296          * @return new PmfmMetImpl()
297          */
298         public static PmfmMet newInstance()
299         {
300             return new PmfmMetImpl();
301         }
302 
303         /**
304          * Constructs a new instance of {@link PmfmMet}, taking all required and/or
305          * read-only properties as arguments, except for identifiers.
306          * @param metaprogramme Metaprogramme
307          * @param parameter Parameter
308          * @return newInstance
309          */
310         public static PmfmMet newInstance(Metaprogramme metaprogramme, Parameter parameter)
311         {
312             final PmfmMet entity = new PmfmMetImpl();
313             entity.setMetaprogramme(metaprogramme);
314             entity.setParameter(parameter);
315             return entity;
316         }
317 
318         /**
319          * Constructs a new instance of {@link PmfmMet}, taking all possible properties
320          * (except the identifier(s))as arguments.
321          * @param updateDt Timestamp
322          * @param unit Unit
323          * @param fraction Fraction
324          * @param monLocMets Collection<MonLocMet>
325          * @param matrix Matrix
326          * @param method Method
327          * @param metaprogramme Metaprogramme
328          * @param parameter Parameter
329          * @return newInstance PmfmMet
330          */
331         public static PmfmMet newInstance(Timestamp updateDt, Unit unit, Fraction fraction, Collection<MonLocMet> monLocMets, Matrix matrix, Method method, Metaprogramme metaprogramme, Parameter parameter)
332         {
333             final PmfmMet entity = new PmfmMetImpl();
334             entity.setUpdateDt(updateDt);
335             entity.setUnit(unit);
336             entity.setFraction(fraction);
337             entity.setMonLocMets(monLocMets);
338             entity.setMatrix(matrix);
339             entity.setMethod(method);
340             entity.setMetaprogramme(metaprogramme);
341             entity.setParameter(parameter);
342             return entity;
343         }
344     }
345 
346     /**
347      * @see Comparable#compareTo
348      */
349     public int compareTo(PmfmMet o)
350     {
351         int cmp = 0;
352         if (this.getPmfmMetId() != null)
353         {
354             cmp = this.getPmfmMetId().compareTo(o.getPmfmMetId());
355         }
356         else
357         {
358             if (this.getUpdateDt() != null)
359             {
360                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
361             }
362         }
363         return cmp;
364     }
365 // HibernateEntity.vsl merge-point
366 // PmfmMet.java merge-point
367 }