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.system;
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.administration.program.Program;
29  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Parameter;
30  import java.io.Serializable;
31  import java.sql.Timestamp;
32  import java.util.Collection;
33  import java.util.HashSet;
34  
35  /**
36   * Contient les différentes fonction de calcul pour les paramètres
37   */
38  // HibernateEntity.vsl annotations merge-point
39  public abstract class ComputeFunction
40      implements Serializable, Comparable<ComputeFunction>
41  {
42      /**
43       * The serial version UID of this class. Needed for serialization.
44       */
45      private static final long serialVersionUID = 5707694753016612813L;
46  
47      // Generate 4 attributes
48      private String compFunctionCd;
49  
50      /**
51       * Code de la fonction de calcul
52       * @return this.compFunctionCd String
53       */
54      public String getCompFunctionCd()
55      {
56          return this.compFunctionCd;
57      }
58  
59      /**
60       * Code de la fonction de calcul
61       * @param compFunctionCdIn String
62       */
63      public void setCompFunctionCd(String compFunctionCdIn)
64      {
65          this.compFunctionCd = compFunctionCdIn;
66      }
67  
68      private String compFunctionNm;
69  
70      /**
71       * Libellé de la fonction de calcul
72       * @return this.compFunctionNm String
73       */
74      public String getCompFunctionNm()
75      {
76          return this.compFunctionNm;
77      }
78  
79      /**
80       * Libellé de la fonction de calcul
81       * @param compFunctionNmIn String
82       */
83      public void setCompFunctionNm(String compFunctionNmIn)
84      {
85          this.compFunctionNm = compFunctionNmIn;
86      }
87  
88      private String compFunctionProcNm;
89  
90      /**
91       * Nom de la procédure cataloguée oracle correspondant
92       * @return this.compFunctionProcNm String
93       */
94      public String getCompFunctionProcNm()
95      {
96          return this.compFunctionProcNm;
97      }
98  
99      /**
100      * Nom de la procédure cataloguée oracle correspondant
101      * @param compFunctionProcNmIn String
102      */
103     public void setCompFunctionProcNm(String compFunctionProcNmIn)
104     {
105         this.compFunctionProcNm = compFunctionProcNmIn;
106     }
107 
108     private Timestamp updateDt;
109 
110     /**
111      * Date de mise à jour
112      * @return this.updateDt Timestamp
113      */
114     public Timestamp getUpdateDt()
115     {
116         return this.updateDt;
117     }
118 
119     /**
120      * Date de mise à jour
121      * @param updateDtIn Timestamp
122      */
123     public void setUpdateDt(Timestamp updateDtIn)
124     {
125         this.updateDt = updateDtIn;
126     }
127 
128     // Generate 3 associations
129     private Collection<ComputeMeasurement> compMeasIds = new HashSet<ComputeMeasurement>();
130 
131     /**
132      * Contient les informations sur les mesures utilisées dans le calcul d'une mesure
133      * @return this.compMeasIds Collection<ComputeMeasurement>
134      */
135     public Collection<ComputeMeasurement> getCompMeasIds()
136     {
137         return this.compMeasIds;
138     }
139 
140     /**
141      * Contient les informations sur les mesures utilisées dans le calcul d'une mesure
142      * @param compMeasIdsIn Collection<ComputeMeasurement>
143      */
144     public void setCompMeasIds(Collection<ComputeMeasurement> compMeasIdsIn)
145     {
146         this.compMeasIds = compMeasIdsIn;
147     }
148 
149     /**
150      * Contient les informations sur les mesures utilisées dans le calcul d'une mesure
151      * @param elementToAdd ComputeMeasurement
152      * @return <tt>true</tt> if this collection changed as a result of the
153      *         call
154      */
155     public boolean addCompMeasIds(ComputeMeasurement elementToAdd)
156     {
157         return this.compMeasIds.add(elementToAdd);
158     }
159 
160     /**
161      * Contient les informations sur les mesures utilisées dans le calcul d'une mesure
162      * @param elementToRemove ComputeMeasurement
163      * @return <tt>true</tt> if this collection changed as a result of the
164      *         call
165      */
166     public boolean removeCompMeasIds(ComputeMeasurement elementToRemove)
167     {
168         return this.compMeasIds.remove(elementToRemove);
169     }
170 
171     private Collection<Program> progCds = new HashSet<Program>();
172 
173     /**
174      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
175      * @return this.progCds Collection<Program>
176      */
177     public Collection<Program> getProgCds()
178     {
179         return this.progCds;
180     }
181 
182     /**
183      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
184      * @param progCdsIn Collection<Program>
185      */
186     public void setProgCds(Collection<Program> progCdsIn)
187     {
188         this.progCds = progCdsIn;
189     }
190 
191     /**
192      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
193      * @param elementToAdd Program
194      * @return <tt>true</tt> if this collection changed as a result of the
195      *         call
196      */
197     public boolean addProgCds(Program elementToAdd)
198     {
199         return this.progCds.add(elementToAdd);
200     }
201 
202     /**
203      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
204      * @param elementToRemove Program
205      * @return <tt>true</tt> if this collection changed as a result of the
206      *         call
207      */
208     public boolean removeProgCds(Program elementToRemove)
209     {
210         return this.progCds.remove(elementToRemove);
211     }
212 
213     private Collection<Parameter> parCds = new HashSet<Parameter>();
214 
215     /**
216      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
217      * @return this.parCds Collection<Parameter>
218      */
219     public Collection<Parameter> getParCds()
220     {
221         return this.parCds;
222     }
223 
224     /**
225      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
226      * @param parCdsIn Collection<Parameter>
227      */
228     public void setParCds(Collection<Parameter> parCdsIn)
229     {
230         this.parCds = parCdsIn;
231     }
232 
233     /**
234      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
235      * @param elementToAdd Parameter
236      * @return <tt>true</tt> if this collection changed as a result of the
237      *         call
238      */
239     public boolean addParCds(Parameter elementToAdd)
240     {
241         return this.parCds.add(elementToAdd);
242     }
243 
244     /**
245      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
246      * @param elementToRemove Parameter
247      * @return <tt>true</tt> if this collection changed as a result of the
248      *         call
249      */
250     public boolean removeParCds(Parameter elementToRemove)
251     {
252         return this.parCds.remove(elementToRemove);
253     }
254 
255     /**
256      * Returns <code>true</code> if the argument is an ComputeFunction instance and all identifiers for this entity
257      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
258      */
259     @Override
260     public boolean equals(Object object)
261     {
262         if (this == object)
263         {
264             return true;
265         }
266         if (!(object instanceof ComputeFunction))
267         {
268             return false;
269         }
270         final ComputeFunction that = (ComputeFunction)object;
271         if (this.compFunctionCd == null || that.getCompFunctionCd() == null || !this.compFunctionCd.equals(that.getCompFunctionCd()))
272         {
273             return false;
274         }
275         return true;
276     }
277 
278     /**
279      * Returns a hash code based on this entity's identifiers.
280      */
281     @Override
282     public int hashCode()
283     {
284         int hashCode = 0;
285         hashCode = 29 * hashCode + (this.compFunctionCd == null ? 0 : this.compFunctionCd.hashCode());
286 
287         return hashCode;
288     }
289 
290     /**
291      * Constructs new instances of {@link ComputeFunction}.
292      */
293     public static final class Factory
294     {
295         /**
296          * Constructs a new instance of {@link ComputeFunction}.
297          * @return new ComputeFunctionImpl()
298          */
299         public static ComputeFunction newInstance()
300         {
301             return new ComputeFunctionImpl();
302         }
303 
304         /**
305          * Constructs a new instance of {@link ComputeFunction}, taking all required and/or
306          * read-only properties as arguments, except for identifiers.
307          * @param compFunctionNm String
308          * @param compFunctionProcNm String
309          * @return newInstance
310          */
311         public static ComputeFunction newInstance(String compFunctionNm, String compFunctionProcNm)
312         {
313             final ComputeFunction entity = new ComputeFunctionImpl();
314             entity.setCompFunctionNm(compFunctionNm);
315             entity.setCompFunctionProcNm(compFunctionProcNm);
316             return entity;
317         }
318 
319         /**
320          * Constructs a new instance of {@link ComputeFunction}, taking all possible properties
321          * (except the identifier(s))as arguments.
322          * @param compFunctionNm String
323          * @param compFunctionProcNm String
324          * @param updateDt Timestamp
325          * @param compMeasIds Collection<ComputeMeasurement>
326          * @param progCds Collection<Program>
327          * @param parCds Collection<Parameter>
328          * @return newInstance ComputeFunction
329          */
330         public static ComputeFunction newInstance(String compFunctionNm, String compFunctionProcNm, Timestamp updateDt, Collection<ComputeMeasurement> compMeasIds, Collection<Program> progCds, Collection<Parameter> parCds)
331         {
332             final ComputeFunction entity = new ComputeFunctionImpl();
333             entity.setCompFunctionNm(compFunctionNm);
334             entity.setCompFunctionProcNm(compFunctionProcNm);
335             entity.setUpdateDt(updateDt);
336             entity.setCompMeasIds(compMeasIds);
337             entity.setProgCds(progCds);
338             entity.setParCds(parCds);
339             return entity;
340         }
341     }
342 
343     /**
344      * @see Comparable#compareTo
345      */
346     public int compareTo(ComputeFunction o)
347     {
348         int cmp = 0;
349         if (this.getCompFunctionCd() != null)
350         {
351             cmp = this.getCompFunctionCd().compareTo(o.getCompFunctionCd());
352         }
353         else
354         {
355             if (this.getCompFunctionNm() != null)
356             {
357                 cmp = (cmp != 0 ? cmp : this.getCompFunctionNm().compareTo(o.getCompFunctionNm()));
358             }
359             if (this.getCompFunctionProcNm() != null)
360             {
361                 cmp = (cmp != 0 ? cmp : this.getCompFunctionProcNm().compareTo(o.getCompFunctionProcNm()));
362             }
363             if (this.getUpdateDt() != null)
364             {
365                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
366             }
367         }
368         return cmp;
369     }
370 // HibernateEntity.vsl merge-point
371 // ComputeFunction.java merge-point
372 }