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