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.metaprogamme;
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.pmfm.Fraction;
30  import fr.ifremer.quadrige2.core.dao.referential.pmfm.Matrix;
31  import fr.ifremer.quadrige2.core.dao.referential.pmfm.Method;
32  import fr.ifremer.quadrige2.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 6 associations
92      private Fraction fraction;
93  
94      /**
95       * Liste les fractions (compléter la description).
96       * @return this.fraction Fraction
97       */
98      public Fraction getFraction()
99      {
100         return this.fraction;
101     }
102 
103     /**
104      * Liste les fractions (compléter la description).
105      * @param fractionIn Fraction
106      */
107     public void setFraction(Fraction fractionIn)
108     {
109         this.fraction = fractionIn;
110     }
111 
112     private Collection<MonLocMet> monLocMets = new HashSet<MonLocMet>();
113 
114     /**
115      * Liste des lieux d'un métaprogramme
116      * @return this.monLocMets Collection<MonLocMet>
117      */
118     public Collection<MonLocMet> getMonLocMets()
119     {
120         return this.monLocMets;
121     }
122 
123     /**
124      * Liste des lieux d'un métaprogramme
125      * @param monLocMetsIn Collection<MonLocMet>
126      */
127     public void setMonLocMets(Collection<MonLocMet> monLocMetsIn)
128     {
129         this.monLocMets = monLocMetsIn;
130     }
131 
132     /**
133      * Liste des lieux d'un métaprogramme
134      * @param elementToAdd MonLocMet
135      * @return <tt>true</tt> if this collection changed as a result of the
136      *         call
137      */
138     public boolean addMonLocMets(MonLocMet elementToAdd)
139     {
140         return this.monLocMets.add(elementToAdd);
141     }
142 
143     /**
144      * Liste des lieux d'un métaprogramme
145      * @param elementToRemove MonLocMet
146      * @return <tt>true</tt> if this collection changed as a result of the
147      *         call
148      */
149     public boolean removeMonLocMets(MonLocMet elementToRemove)
150     {
151         return this.monLocMets.remove(elementToRemove);
152     }
153 
154     private Matrix matrix;
155 
156     /**
157      * Support utilisé pour mesurer un paramètre.
158      * @return this.matrix Matrix
159      */
160     public Matrix getMatrix()
161     {
162         return this.matrix;
163     }
164 
165     /**
166      * Support utilisé pour mesurer un paramètre.
167      * @param matrixIn Matrix
168      */
169     public void setMatrix(Matrix matrixIn)
170     {
171         this.matrix = matrixIn;
172     }
173 
174     private Method method;
175 
176     /**
177      * Méthode utilisée pour mesurer un paramètre.
178      * @return this.method Method
179      */
180     public Method getMethod()
181     {
182         return this.method;
183     }
184 
185     /**
186      * Méthode utilisée pour mesurer un paramètre.
187      * @param methodIn Method
188      */
189     public void setMethod(Method methodIn)
190     {
191         this.method = methodIn;
192     }
193 
194     private Metaprogramme metaprogramme;
195 
196     /**
197      * Programme virtuel (métaprogramme)
198      * @return this.metaprogramme Metaprogramme
199      */
200     public Metaprogramme getMetaprogramme()
201     {
202         return this.metaprogramme;
203     }
204 
205     /**
206      * Programme virtuel (métaprogramme)
207      * @param metaprogrammeIn Metaprogramme
208      */
209     public void setMetaprogramme(Metaprogramme metaprogrammeIn)
210     {
211         this.metaprogramme = metaprogrammeIn;
212     }
213 
214     private Parameter parameter;
215 
216     /**
217      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
218      * @return this.parameter Parameter
219      */
220     public Parameter getParameter()
221     {
222         return this.parameter;
223     }
224 
225     /**
226      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
227      * @param parameterIn Parameter
228      */
229     public void setParameter(Parameter parameterIn)
230     {
231         this.parameter = parameterIn;
232     }
233 
234     /**
235      * Returns <code>true</code> if the argument is an PmfmMet instance and all identifiers for this entity
236      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
237      */
238     @Override
239     public boolean equals(Object object)
240     {
241         if (this == object)
242         {
243             return true;
244         }
245         if (!(object instanceof PmfmMet))
246         {
247             return false;
248         }
249         final PmfmMet that = (PmfmMet)object;
250         if (this.pmfmMetId == null || that.getPmfmMetId() == null || !this.pmfmMetId.equals(that.getPmfmMetId()))
251         {
252             return false;
253         }
254         return true;
255     }
256 
257     /**
258      * Returns a hash code based on this entity's identifiers.
259      */
260     @Override
261     public int hashCode()
262     {
263         int hashCode = 0;
264         hashCode = 29 * hashCode + (this.pmfmMetId == null ? 0 : this.pmfmMetId.hashCode());
265 
266         return hashCode;
267     }
268 
269     /**
270      * Constructs new instances of {@link PmfmMet}.
271      */
272     public static final class Factory
273     {
274         /**
275          * Constructs a new instance of {@link PmfmMet}.
276          * @return new PmfmMetImpl()
277          */
278         public static PmfmMet newInstance()
279         {
280             return new PmfmMetImpl();
281         }
282 
283         /**
284          * Constructs a new instance of {@link PmfmMet}, taking all required and/or
285          * read-only properties as arguments, except for identifiers.
286          * @param updateDt Timestamp
287          * @param metaprogramme Metaprogramme
288          * @param parameter Parameter
289          * @return newInstance
290          */
291         public static PmfmMet newInstance(Timestamp updateDt, Metaprogramme metaprogramme, Parameter parameter)
292         {
293             final PmfmMet entity = new PmfmMetImpl();
294             entity.setUpdateDt(updateDt);
295             entity.setMetaprogramme(metaprogramme);
296             entity.setParameter(parameter);
297             return entity;
298         }
299 
300         /**
301          * Constructs a new instance of {@link PmfmMet}, taking all possible properties
302          * (except the identifier(s))as arguments.
303          * @param updateDt Timestamp
304          * @param fraction Fraction
305          * @param monLocMets Collection<MonLocMet>
306          * @param matrix Matrix
307          * @param method Method
308          * @param metaprogramme Metaprogramme
309          * @param parameter Parameter
310          * @return newInstance PmfmMet
311          */
312         public static PmfmMet newInstance(Timestamp updateDt, Fraction fraction, Collection<MonLocMet> monLocMets, Matrix matrix, Method method, Metaprogramme metaprogramme, Parameter parameter)
313         {
314             final PmfmMet entity = new PmfmMetImpl();
315             entity.setUpdateDt(updateDt);
316             entity.setFraction(fraction);
317             entity.setMonLocMets(monLocMets);
318             entity.setMatrix(matrix);
319             entity.setMethod(method);
320             entity.setMetaprogramme(metaprogramme);
321             entity.setParameter(parameter);
322             return entity;
323         }
324     }
325 
326     /**
327      * @see Comparable#compareTo
328      */
329     public int compareTo(PmfmMet o)
330     {
331         int cmp = 0;
332         if (this.getPmfmMetId() != null)
333         {
334             cmp = this.getPmfmMetId().compareTo(o.getPmfmMetId());
335         }
336         else
337         {
338             if (this.getUpdateDt() != null)
339             {
340                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
341             }
342         }
343         return cmp;
344     }
345 // HibernateEntity.vsl merge-point
346 // PmfmMet.java merge-point
347 }