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.referential;
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.sandre.SandreDepthLevelExp;
30  import fr.ifremer.quadrige2.core.dao.sandre.SandreDepthLevelImp;
31  import java.io.Serializable;
32  import java.sql.Timestamp;
33  import java.util.Collection;
34  import java.util.HashSet;
35  
36  /**
37   * Liste des niveaux auxquels les prélèvements peuvent être effectués.
38   */
39  // HibernateEntity.vsl annotations merge-point
40  public abstract class DepthLevel
41      implements Serializable, Comparable<DepthLevel>
42  {
43      /**
44       * The serial version UID of this class. Needed for serialization.
45       */
46      private static final long serialVersionUID = 8248132632609809042L;
47  
48      // Generate 4 attributes
49      private Integer depthLevelId;
50  
51      /**
52       * Identifiant interne du niveau de prélèvement
53       * @return this.depthLevelId Integer
54       */
55      public Integer getDepthLevelId()
56      {
57          return this.depthLevelId;
58      }
59  
60      /**
61       * Identifiant interne du niveau de prélèvement
62       * @param depthLevelIdIn Integer
63       */
64      public void setDepthLevelId(Integer depthLevelIdIn)
65      {
66          this.depthLevelId = depthLevelIdIn;
67      }
68  
69      private String depthLevelNm;
70  
71      /**
72       * Libellé du niveau
73       * @return this.depthLevelNm String
74       */
75      public String getDepthLevelNm()
76      {
77          return this.depthLevelNm;
78      }
79  
80      /**
81       * Libellé du niveau
82       * @param depthLevelNmIn String
83       */
84      public void setDepthLevelNm(String depthLevelNmIn)
85      {
86          this.depthLevelNm = depthLevelNmIn;
87      }
88  
89      private String depthLevelDc;
90  
91      /**
92       * Description du niveau
93       * @return this.depthLevelDc String
94       */
95      public String getDepthLevelDc()
96      {
97          return this.depthLevelDc;
98      }
99  
100     /**
101      * Description du niveau
102      * @param depthLevelDcIn String
103      */
104     public void setDepthLevelDc(String depthLevelDcIn)
105     {
106         this.depthLevelDc = depthLevelDcIn;
107     }
108 
109     private Timestamp updateDt;
110 
111     /**
112      * Date de modification de l'objet, mise à jour par le système
113      * @return this.updateDt Timestamp
114      */
115     public Timestamp getUpdateDt()
116     {
117         return this.updateDt;
118     }
119 
120     /**
121      * Date de modification de l'objet, mise à jour par le système
122      * @param updateDtIn Timestamp
123      */
124     public void setUpdateDt(Timestamp updateDtIn)
125     {
126         this.updateDt = updateDtIn;
127     }
128 
129     // Generate 5 associations
130     private Collection<SandreDepthLevelImp> sandreDepthLevelImpIds = new HashSet<SandreDepthLevelImp>();
131 
132     /**
133      * Table des niveaux de prélèvement du sandre pour les imports de données
134      * @return this.sandreDepthLevelImpIds Collection<SandreDepthLevelImp>
135      */
136     public Collection<SandreDepthLevelImp> getSandreDepthLevelImpIds()
137     {
138         return this.sandreDepthLevelImpIds;
139     }
140 
141     /**
142      * Table des niveaux de prélèvement du sandre pour les imports de données
143      * @param sandreDepthLevelImpIdsIn Collection<SandreDepthLevelImp>
144      */
145     public void setSandreDepthLevelImpIds(Collection<SandreDepthLevelImp> sandreDepthLevelImpIdsIn)
146     {
147         this.sandreDepthLevelImpIds = sandreDepthLevelImpIdsIn;
148     }
149 
150     /**
151      * Table des niveaux de prélèvement du sandre pour les imports de données
152      * @param elementToAdd SandreDepthLevelImp
153      * @return <tt>true</tt> if this collection changed as a result of the
154      *         call
155      */
156     public boolean addSandreDepthLevelImpIds(SandreDepthLevelImp elementToAdd)
157     {
158         return this.sandreDepthLevelImpIds.add(elementToAdd);
159     }
160 
161     /**
162      * Table des niveaux de prélèvement du sandre pour les imports de données
163      * @param elementToRemove SandreDepthLevelImp
164      * @return <tt>true</tt> if this collection changed as a result of the
165      *         call
166      */
167     public boolean removeSandreDepthLevelImpIds(SandreDepthLevelImp elementToRemove)
168     {
169         return this.sandreDepthLevelImpIds.remove(elementToRemove);
170     }
171 
172     private Collection<SandreDepthLevelExp> sandreDepthLevelExpIds = new HashSet<SandreDepthLevelExp>();
173 
174     /**
175      * Table des niveaux de prélèvement du sandre pour les exports de données
176      * @return this.sandreDepthLevelExpIds Collection<SandreDepthLevelExp>
177      */
178     public Collection<SandreDepthLevelExp> getSandreDepthLevelExpIds()
179     {
180         return this.sandreDepthLevelExpIds;
181     }
182 
183     /**
184      * Table des niveaux de prélèvement du sandre pour les exports de données
185      * @param sandreDepthLevelExpIdsIn Collection<SandreDepthLevelExp>
186      */
187     public void setSandreDepthLevelExpIds(Collection<SandreDepthLevelExp> sandreDepthLevelExpIdsIn)
188     {
189         this.sandreDepthLevelExpIds = sandreDepthLevelExpIdsIn;
190     }
191 
192     /**
193      * Table des niveaux de prélèvement du sandre pour les exports de données
194      * @param elementToAdd SandreDepthLevelExp
195      * @return <tt>true</tt> if this collection changed as a result of the
196      *         call
197      */
198     public boolean addSandreDepthLevelExpIds(SandreDepthLevelExp elementToAdd)
199     {
200         return this.sandreDepthLevelExpIds.add(elementToAdd);
201     }
202 
203     /**
204      * Table des niveaux de prélèvement du sandre pour les exports de données
205      * @param elementToRemove SandreDepthLevelExp
206      * @return <tt>true</tt> if this collection changed as a result of the
207      *         call
208      */
209     public boolean removeSandreDepthLevelExpIds(SandreDepthLevelExp elementToRemove)
210     {
211         return this.sandreDepthLevelExpIds.remove(elementToRemove);
212     }
213 
214     private Status status;
215 
216     /**
217      * Liste des états possibles d'un objet.
218      * @return this.status Status
219      */
220     public Status getStatus()
221     {
222         return this.status;
223     }
224 
225     /**
226      * Liste des états possibles d'un objet.
227      * @param statusIn Status
228      */
229     public void setStatus(Status statusIn)
230     {
231         this.status = statusIn;
232     }
233 
234     /**
235      * Returns <code>true</code> if the argument is an DepthLevel 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 DepthLevel))
246         {
247             return false;
248         }
249         final DepthLevel that = (DepthLevel)object;
250         if (this.depthLevelId == null || that.getDepthLevelId() == null || !this.depthLevelId.equals(that.getDepthLevelId()))
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.depthLevelId == null ? 0 : this.depthLevelId.hashCode());
265 
266         return hashCode;
267     }
268 
269     /**
270      * Constructs new instances of {@link DepthLevel}.
271      */
272     public static final class Factory
273     {
274         /**
275          * Constructs a new instance of {@link DepthLevel}.
276          * @return new DepthLevelImpl()
277          */
278         public static DepthLevel newInstance()
279         {
280             return new DepthLevelImpl();
281         }
282 
283         /**
284          * Constructs a new instance of {@link DepthLevel}, taking all required and/or
285          * read-only properties as arguments, except for identifiers.
286          * @param depthLevelNm String
287          * @param updateDt Timestamp
288          * @param status Status
289          * @return newInstance
290          */
291         public static DepthLevel newInstance(String depthLevelNm, Timestamp updateDt, Status status)
292         {
293             final DepthLevel entity = new DepthLevelImpl();
294             entity.setDepthLevelNm(depthLevelNm);
295             entity.setUpdateDt(updateDt);
296             entity.setStatus(status);
297             return entity;
298         }
299 
300         /**
301          * Constructs a new instance of {@link DepthLevel}, taking all possible properties
302          * (except the identifier(s))as arguments.
303          * @param depthLevelNm String
304          * @param depthLevelDc String
305          * @param updateDt Timestamp
306          * @param sandreDepthLevelImpIds Collection<SandreDepthLevelImp>
307          * @param sandreDepthLevelExpIds Collection<SandreDepthLevelExp>
308          * @param status Status
309          * @return newInstance DepthLevel
310          */
311         public static DepthLevel newInstance(String depthLevelNm, String depthLevelDc, Timestamp updateDt, Collection<SandreDepthLevelImp> sandreDepthLevelImpIds, Collection<SandreDepthLevelExp> sandreDepthLevelExpIds, Status status)
312         {
313             final DepthLevel entity = new DepthLevelImpl();
314             entity.setDepthLevelNm(depthLevelNm);
315             entity.setDepthLevelDc(depthLevelDc);
316             entity.setUpdateDt(updateDt);
317             entity.setSandreDepthLevelImpIds(sandreDepthLevelImpIds);
318             entity.setSandreDepthLevelExpIds(sandreDepthLevelExpIds);
319             entity.setStatus(status);
320             return entity;
321         }
322     }
323 
324     /**
325      * @see Comparable#compareTo
326      */
327     public int compareTo(DepthLevel o)
328     {
329         int cmp = 0;
330         if (this.getDepthLevelId() != null)
331         {
332             cmp = this.getDepthLevelId().compareTo(o.getDepthLevelId());
333         }
334         else
335         {
336             if (this.getDepthLevelNm() != null)
337             {
338                 cmp = (cmp != 0 ? cmp : this.getDepthLevelNm().compareTo(o.getDepthLevelNm()));
339             }
340             if (this.getDepthLevelDc() != null)
341             {
342                 cmp = (cmp != 0 ? cmp : this.getDepthLevelDc().compareTo(o.getDepthLevelDc()));
343             }
344             if (this.getUpdateDt() != null)
345             {
346                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
347             }
348         }
349         return cmp;
350     }
351 // HibernateEntity.vsl merge-point
352 // DepthLevel.java merge-point
353 }