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