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