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.eunis;
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 java.io.Serializable;
29  import java.sql.Timestamp;
30  import java.util.Collection;
31  import java.util.Date;
32  import java.util.HashSet;
33  
34  /**
35   * Liste des versions des différentes typologies EUNIS.
36   */
37  // HibernateEntity.vsl annotations merge-point
38  public abstract class EunisVersion
39      implements Serializable, Comparable<EunisVersion>
40  {
41      /**
42       * The serial version UID of this class. Needed for serialization.
43       */
44      private static final long serialVersionUID = -7366798727008104837L;
45  
46      // Generate 6 attributes
47      private Integer eunisVersionId;
48  
49      /**
50       * Identifiant interne de la version EUNIS
51       * @return this.eunisVersionId Integer
52       */
53      public Integer getEunisVersionId()
54      {
55          return this.eunisVersionId;
56      }
57  
58      /**
59       * Identifiant interne de la version EUNIS
60       * @param eunisVersionIdIn Integer
61       */
62      public void setEunisVersionId(Integer eunisVersionIdIn)
63      {
64          this.eunisVersionId = eunisVersionIdIn;
65      }
66  
67      private Date eunisVersionDt;
68  
69      /**
70       * Date de réception de la version
71       * @return this.eunisVersionDt Date
72       */
73      public Date getEunisVersionDt()
74      {
75          return this.eunisVersionDt;
76      }
77  
78      /**
79       * Date de réception de la version
80       * @param eunisVersionDtIn Date
81       */
82      public void setEunisVersionDt(Date eunisVersionDtIn)
83      {
84          this.eunisVersionDt = eunisVersionDtIn;
85      }
86  
87      private String eunisVersionNm;
88  
89      /**
90       * Libellé de la version
91       * @return this.eunisVersionNm String
92       */
93      public String getEunisVersionNm()
94      {
95          return this.eunisVersionNm;
96      }
97  
98      /**
99       * Libellé de la version
100      * @param eunisVersionNmIn String
101      */
102     public void setEunisVersionNm(String eunisVersionNmIn)
103     {
104         this.eunisVersionNm = eunisVersionNmIn;
105     }
106 
107     private String eunisVersionCm;
108 
109     /**
110      * Description de la version
111      * @return this.eunisVersionCm String
112      */
113     public String getEunisVersionCm()
114     {
115         return this.eunisVersionCm;
116     }
117 
118     /**
119      * Description de la version
120      * @param eunisVersionCmIn String
121      */
122     public void setEunisVersionCm(String eunisVersionCmIn)
123     {
124         this.eunisVersionCm = eunisVersionCmIn;
125     }
126 
127     private String eunisVersionIsCurrent;
128 
129     /**
130      * Indique s'il s'agit de la dernière version ou non
131      * @return this.eunisVersionIsCurrent String
132      */
133     public String getEunisVersionIsCurrent()
134     {
135         return this.eunisVersionIsCurrent;
136     }
137 
138     /**
139      * Indique s'il s'agit de la dernière version ou non
140      * @param eunisVersionIsCurrentIn String
141      */
142     public void setEunisVersionIsCurrent(String eunisVersionIsCurrentIn)
143     {
144         this.eunisVersionIsCurrent = eunisVersionIsCurrentIn;
145     }
146 
147     private Timestamp updateDt;
148 
149     /**
150      * Date de modification de l'objet, mise à jour par le système
151      * @return this.updateDt Timestamp
152      */
153     public Timestamp getUpdateDt()
154     {
155         return this.updateDt;
156     }
157 
158     /**
159      * Date de modification de l'objet, mise à jour par le système
160      * @param updateDtIn Timestamp
161      */
162     public void setUpdateDt(Timestamp updateDtIn)
163     {
164         this.updateDt = updateDtIn;
165     }
166 
167     // Generate 1 associations
168     private Collection<EunisTypology> eunisTypIds = new HashSet<EunisTypology>();
169 
170     /**
171      * Typologie EUNIS
172      * @return this.eunisTypIds Collection<EunisTypology>
173      */
174     public Collection<EunisTypology> getEunisTypIds()
175     {
176         return this.eunisTypIds;
177     }
178 
179     /**
180      * Typologie EUNIS
181      * @param eunisTypIdsIn Collection<EunisTypology>
182      */
183     public void setEunisTypIds(Collection<EunisTypology> eunisTypIdsIn)
184     {
185         this.eunisTypIds = eunisTypIdsIn;
186     }
187 
188     /**
189      * Typologie EUNIS
190      * @param elementToAdd EunisTypology
191      * @return <tt>true</tt> if this collection changed as a result of the
192      *         call
193      */
194     public boolean addEunisTypIds(EunisTypology elementToAdd)
195     {
196         return this.eunisTypIds.add(elementToAdd);
197     }
198 
199     /**
200      * Typologie EUNIS
201      * @param elementToRemove EunisTypology
202      * @return <tt>true</tt> if this collection changed as a result of the
203      *         call
204      */
205     public boolean removeEunisTypIds(EunisTypology elementToRemove)
206     {
207         return this.eunisTypIds.remove(elementToRemove);
208     }
209 
210     /**
211      * Returns <code>true</code> if the argument is an EunisVersion instance and all identifiers for this entity
212      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
213      */
214     @Override
215     public boolean equals(Object object)
216     {
217         if (this == object)
218         {
219             return true;
220         }
221         if (!(object instanceof EunisVersion))
222         {
223             return false;
224         }
225         final EunisVersion that = (EunisVersion)object;
226         if (this.eunisVersionId == null || that.getEunisVersionId() == null || !this.eunisVersionId.equals(that.getEunisVersionId()))
227         {
228             return false;
229         }
230         return true;
231     }
232 
233     /**
234      * Returns a hash code based on this entity's identifiers.
235      */
236     @Override
237     public int hashCode()
238     {
239         int hashCode = 0;
240         hashCode = 29 * hashCode + (this.eunisVersionId == null ? 0 : this.eunisVersionId.hashCode());
241 
242         return hashCode;
243     }
244 
245     /**
246      * Constructs new instances of {@link EunisVersion}.
247      */
248     public static final class Factory
249     {
250         /**
251          * Constructs a new instance of {@link EunisVersion}.
252          * @return new EunisVersionImpl()
253          */
254         public static EunisVersion newInstance()
255         {
256             return new EunisVersionImpl();
257         }
258 
259         /**
260          * Constructs a new instance of {@link EunisVersion}, taking all required and/or
261          * read-only properties as arguments, except for identifiers.
262          * @param eunisVersionNm String
263          * @return newInstance
264          */
265         public static EunisVersion newInstance(String eunisVersionNm)
266         {
267             final EunisVersion entity = new EunisVersionImpl();
268             entity.setEunisVersionNm(eunisVersionNm);
269             return entity;
270         }
271 
272         /**
273          * Constructs a new instance of {@link EunisVersion}, taking all possible properties
274          * (except the identifier(s))as arguments.
275          * @param eunisVersionDt Date
276          * @param eunisVersionNm String
277          * @param eunisVersionCm String
278          * @param eunisVersionIsCurrent String
279          * @param updateDt Timestamp
280          * @param eunisTypIds Collection<EunisTypology>
281          * @return newInstance EunisVersion
282          */
283         public static EunisVersion newInstance(Date eunisVersionDt, String eunisVersionNm, String eunisVersionCm, String eunisVersionIsCurrent, Timestamp updateDt, Collection<EunisTypology> eunisTypIds)
284         {
285             final EunisVersion entity = new EunisVersionImpl();
286             entity.setEunisVersionDt(eunisVersionDt);
287             entity.setEunisVersionNm(eunisVersionNm);
288             entity.setEunisVersionCm(eunisVersionCm);
289             entity.setEunisVersionIsCurrent(eunisVersionIsCurrent);
290             entity.setUpdateDt(updateDt);
291             entity.setEunisTypIds(eunisTypIds);
292             return entity;
293         }
294     }
295 
296     /**
297      * @see Comparable#compareTo
298      */
299     public int compareTo(EunisVersion o)
300     {
301         int cmp = 0;
302         if (this.getEunisVersionId() != null)
303         {
304             cmp = this.getEunisVersionId().compareTo(o.getEunisVersionId());
305         }
306         else
307         {
308             if (this.getEunisVersionDt() != null)
309             {
310                 cmp = (cmp != 0 ? cmp : this.getEunisVersionDt().compareTo(o.getEunisVersionDt()));
311             }
312             if (this.getEunisVersionNm() != null)
313             {
314                 cmp = (cmp != 0 ? cmp : this.getEunisVersionNm().compareTo(o.getEunisVersionNm()));
315             }
316             if (this.getEunisVersionCm() != null)
317             {
318                 cmp = (cmp != 0 ? cmp : this.getEunisVersionCm().compareTo(o.getEunisVersionCm()));
319             }
320             if (this.getEunisVersionIsCurrent() != null)
321             {
322                 cmp = (cmp != 0 ? cmp : this.getEunisVersionIsCurrent().compareTo(o.getEunisVersionIsCurrent()));
323             }
324             if (this.getUpdateDt() != null)
325             {
326                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
327             }
328         }
329         return cmp;
330     }
331 // HibernateEntity.vsl merge-point
332 // EunisVersion.java merge-point
333 }