1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.referential.eunis;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
37
38
39 public abstract class EunisVersion
40 implements Serializable, Comparable<EunisVersion>
41 {
42
43
44
45 private static final long serialVersionUID = -7366798727008104837L;
46
47
48 private Integer eunisVersionId;
49
50
51
52
53
54 public Integer getEunisVersionId()
55 {
56 return this.eunisVersionId;
57 }
58
59
60
61
62
63 public void setEunisVersionId(Integer eunisVersionIdIn)
64 {
65 this.eunisVersionId = eunisVersionIdIn;
66 }
67
68 private Date eunisVersionDt;
69
70
71
72
73
74 public Date getEunisVersionDt()
75 {
76 return this.eunisVersionDt;
77 }
78
79
80
81
82
83 public void setEunisVersionDt(Date eunisVersionDtIn)
84 {
85 this.eunisVersionDt = eunisVersionDtIn;
86 }
87
88 private String eunisVersionNm;
89
90
91
92
93
94 public String getEunisVersionNm()
95 {
96 return this.eunisVersionNm;
97 }
98
99
100
101
102
103 public void setEunisVersionNm(String eunisVersionNmIn)
104 {
105 this.eunisVersionNm = eunisVersionNmIn;
106 }
107
108 private String eunisVersionCm;
109
110
111
112
113
114 public String getEunisVersionCm()
115 {
116 return this.eunisVersionCm;
117 }
118
119
120
121
122
123 public void setEunisVersionCm(String eunisVersionCmIn)
124 {
125 this.eunisVersionCm = eunisVersionCmIn;
126 }
127
128 private String eunisVersionIsCurrent;
129
130
131
132
133
134 public String getEunisVersionIsCurrent()
135 {
136 return this.eunisVersionIsCurrent;
137 }
138
139
140
141
142
143 public void setEunisVersionIsCurrent(String eunisVersionIsCurrentIn)
144 {
145 this.eunisVersionIsCurrent = eunisVersionIsCurrentIn;
146 }
147
148 private Timestamp updateDt;
149
150
151
152
153
154 public Timestamp getUpdateDt()
155 {
156 return this.updateDt;
157 }
158
159
160
161
162
163 public void setUpdateDt(Timestamp updateDtIn)
164 {
165 this.updateDt = updateDtIn;
166 }
167
168
169 private Collection<EunisTypology> eunisTypIds = new HashSet<EunisTypology>();
170
171
172
173
174
175 public Collection<EunisTypology> getEunisTypIds()
176 {
177 return this.eunisTypIds;
178 }
179
180
181
182
183
184 public void setEunisTypIds(Collection<EunisTypology> eunisTypIdsIn)
185 {
186 this.eunisTypIds = eunisTypIdsIn;
187 }
188
189
190
191
192
193
194
195 public boolean addEunisTypIds(EunisTypology elementToAdd)
196 {
197 return this.eunisTypIds.add(elementToAdd);
198 }
199
200
201
202
203
204
205
206 public boolean removeEunisTypIds(EunisTypology elementToRemove)
207 {
208 return this.eunisTypIds.remove(elementToRemove);
209 }
210
211
212
213
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
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
248
249 public static final class Factory
250 {
251
252
253
254
255 public static EunisVersion newInstance()
256 {
257 return new EunisVersionImpl();
258 }
259
260
261
262
263
264
265
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
277
278
279
280
281
282
283
284
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
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
335
336 }