1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.data.survey;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 import fr.ifremer.quadrige3.core.dao.administration.user.Department;
29 import fr.ifremer.quadrige3.core.dao.referential.QualityFlag;
30 import fr.ifremer.quadrige3.core.dao.referential.eunis.EunisTypology;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33 import java.util.Date;
34
35
36
37
38
39 public abstract class ObservedHabitat
40 implements Serializable, Comparable<ObservedHabitat>
41 {
42
43
44
45 private static final long serialVersionUID = -1072241682098508233L;
46
47
48 private String observHabCm;
49
50
51
52
53
54 public String getObservHabCm()
55 {
56 return this.observHabCm;
57 }
58
59
60
61
62
63 public void setObservHabCm(String observHabCmIn)
64 {
65 this.observHabCm = observHabCmIn;
66 }
67
68 private Date observHabValidDt;
69
70
71
72
73
74 public Date getObservHabValidDt()
75 {
76 return this.observHabValidDt;
77 }
78
79
80
81
82
83 public void setObservHabValidDt(Date observHabValidDtIn)
84 {
85 this.observHabValidDt = observHabValidDtIn;
86 }
87
88 private Date observHabQualifDt;
89
90
91
92
93
94 public Date getObservHabQualifDt()
95 {
96 return this.observHabQualifDt;
97 }
98
99
100
101
102
103 public void setObservHabQualifDt(Date observHabQualifDtIn)
104 {
105 this.observHabQualifDt = observHabQualifDtIn;
106 }
107
108 private String observHabQualifCm;
109
110
111
112
113
114
115
116
117
118 public String getObservHabQualifCm()
119 {
120 return this.observHabQualifCm;
121 }
122
123
124
125
126
127
128
129
130
131 public void setObservHabQualifCm(String observHabQualifCmIn)
132 {
133 this.observHabQualifCm = observHabQualifCmIn;
134 }
135
136 private Timestamp updateDt;
137
138
139
140
141
142 public Timestamp getUpdateDt()
143 {
144 return this.updateDt;
145 }
146
147
148
149
150
151 public void setUpdateDt(Timestamp updateDtIn)
152 {
153 this.updateDt = updateDtIn;
154 }
155
156 private Integer observedHabitatId;
157
158
159
160
161
162 public Integer getObservedHabitatId()
163 {
164 return this.observedHabitatId;
165 }
166
167
168
169
170
171 public void setObservedHabitatId(Integer observedHabitatIdIn)
172 {
173 this.observedHabitatId = observedHabitatIdIn;
174 }
175
176 private Integer remoteId;
177
178
179
180
181
182 public Integer getRemoteId()
183 {
184 return this.remoteId;
185 }
186
187
188
189
190
191 public void setRemoteId(Integer remoteIdIn)
192 {
193 this.remoteId = remoteIdIn;
194 }
195
196
197 private QualityFlag qualityFlag;
198
199
200
201
202
203 public QualityFlag getQualityFlag()
204 {
205 return this.qualityFlag;
206 }
207
208
209
210
211
212 public void setQualityFlag(QualityFlag qualityFlagIn)
213 {
214 this.qualityFlag = qualityFlagIn;
215 }
216
217 private EunisTypology eunisTypology;
218
219
220
221
222
223 public EunisTypology getEunisTypology()
224 {
225 return this.eunisTypology;
226 }
227
228
229
230
231
232 public void setEunisTypology(EunisTypology eunisTypologyIn)
233 {
234 this.eunisTypology = eunisTypologyIn;
235 }
236
237 private Department recorderDepartment;
238
239
240
241
242
243 public Department getRecorderDepartment()
244 {
245 return this.recorderDepartment;
246 }
247
248
249
250
251
252 public void setRecorderDepartment(Department recorderDepartmentIn)
253 {
254 this.recorderDepartment = recorderDepartmentIn;
255 }
256
257 private Survey survey;
258
259
260
261
262
263
264 public Survey getSurvey()
265 {
266 return this.survey;
267 }
268
269
270
271
272
273
274 public void setSurvey(Survey surveyIn)
275 {
276 this.survey = surveyIn;
277 }
278
279
280
281
282
283 @Override
284 public boolean equals(Object object)
285 {
286 if (this == object)
287 {
288 return true;
289 }
290 if (!(object instanceof ObservedHabitat))
291 {
292 return false;
293 }
294 final ObservedHabitat that = (ObservedHabitat)object;
295 if (this.observedHabitatId == null || that.getObservedHabitatId() == null || !this.observedHabitatId.equals(that.getObservedHabitatId()))
296 {
297 return false;
298 }
299 return true;
300 }
301
302
303
304
305 @Override
306 public int hashCode()
307 {
308 int hashCode = 0;
309 hashCode = 29 * hashCode + (this.observedHabitatId == null ? 0 : this.observedHabitatId.hashCode());
310
311 return hashCode;
312 }
313
314
315
316
317 public static final class Factory
318 {
319
320
321
322
323 public static ObservedHabitat newInstance()
324 {
325 return new ObservedHabitatImpl();
326 }
327
328
329
330
331
332
333
334
335
336 public static ObservedHabitat newInstance(QualityFlag qualityFlag, EunisTypology eunisTypology, Survey survey)
337 {
338 final ObservedHabitat entity = new ObservedHabitatImpl();
339 entity.setQualityFlag(qualityFlag);
340 entity.setEunisTypology(eunisTypology);
341 entity.setSurvey(survey);
342 return entity;
343 }
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360 public static ObservedHabitat newInstance(String observHabCm, Date observHabValidDt, Date observHabQualifDt, String observHabQualifCm, Timestamp updateDt, Integer remoteId, QualityFlag qualityFlag, EunisTypology eunisTypology, Department recorderDepartment, Survey survey)
361 {
362 final ObservedHabitat entity = new ObservedHabitatImpl();
363 entity.setObservHabCm(observHabCm);
364 entity.setObservHabValidDt(observHabValidDt);
365 entity.setObservHabQualifDt(observHabQualifDt);
366 entity.setObservHabQualifCm(observHabQualifCm);
367 entity.setUpdateDt(updateDt);
368 entity.setRemoteId(remoteId);
369 entity.setQualityFlag(qualityFlag);
370 entity.setEunisTypology(eunisTypology);
371 entity.setRecorderDepartment(recorderDepartment);
372 entity.setSurvey(survey);
373 return entity;
374 }
375 }
376
377
378
379
380 public int compareTo(ObservedHabitat o)
381 {
382 int cmp = 0;
383 if (this.getObservedHabitatId() != null)
384 {
385 cmp = this.getObservedHabitatId().compareTo(o.getObservedHabitatId());
386 }
387 else
388 {
389 if (this.getObservHabCm() != null)
390 {
391 cmp = (cmp != 0 ? cmp : this.getObservHabCm().compareTo(o.getObservHabCm()));
392 }
393 if (this.getObservHabValidDt() != null)
394 {
395 cmp = (cmp != 0 ? cmp : this.getObservHabValidDt().compareTo(o.getObservHabValidDt()));
396 }
397 if (this.getObservHabQualifDt() != null)
398 {
399 cmp = (cmp != 0 ? cmp : this.getObservHabQualifDt().compareTo(o.getObservHabQualifDt()));
400 }
401 if (this.getObservHabQualifCm() != null)
402 {
403 cmp = (cmp != 0 ? cmp : this.getObservHabQualifCm().compareTo(o.getObservHabQualifCm()));
404 }
405 if (this.getUpdateDt() != null)
406 {
407 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
408 }
409 if (this.getRemoteId() != null)
410 {
411 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
412 }
413 }
414 return cmp;
415 }
416
417
418 }