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.program.Program;
29 import fr.ifremer.quadrige3.core.dao.administration.user.Department;
30 import fr.ifremer.quadrige3.core.dao.referential.QualityFlag;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33 import java.util.Collection;
34 import java.util.Date;
35 import java.util.HashSet;
36
37
38
39
40
41
42
43 public abstract class MeasuredProfile
44 implements Serializable, Comparable<MeasuredProfile>
45 {
46
47
48
49 private static final long serialVersionUID = -1776400112077976569L;
50
51
52 private Integer measProfId;
53
54
55
56
57
58
59 public Integer getMeasProfId()
60 {
61 return this.measProfId;
62 }
63
64
65
66
67
68
69 public void setMeasProfId(Integer measProfIdIn)
70 {
71 this.measProfId = measProfIdIn;
72 }
73
74 private String measProfDc;
75
76
77
78
79
80 public String getMeasProfDc()
81 {
82 return this.measProfDc;
83 }
84
85
86
87
88
89 public void setMeasProfDc(String measProfDcIn)
90 {
91 this.measProfDc = measProfDcIn;
92 }
93
94 private String measProfUpload;
95
96
97
98
99
100 public String getMeasProfUpload()
101 {
102 return this.measProfUpload;
103 }
104
105
106
107
108
109 public void setMeasProfUpload(String measProfUploadIn)
110 {
111 this.measProfUpload = measProfUploadIn;
112 }
113
114 private Date measProfCreationDt;
115
116
117
118
119
120 public Date getMeasProfCreationDt()
121 {
122 return this.measProfCreationDt;
123 }
124
125
126
127
128
129 public void setMeasProfCreationDt(Date measProfCreationDtIn)
130 {
131 this.measProfCreationDt = measProfCreationDtIn;
132 }
133
134 private Timestamp updateDt;
135
136
137
138
139
140 public Timestamp getUpdateDt()
141 {
142 return this.updateDt;
143 }
144
145
146
147
148
149 public void setUpdateDt(Timestamp updateDtIn)
150 {
151 this.updateDt = updateDtIn;
152 }
153
154 private Date measProfValidDt;
155
156
157
158
159
160 public Date getMeasProfValidDt()
161 {
162 return this.measProfValidDt;
163 }
164
165
166
167
168
169 public void setMeasProfValidDt(Date measProfValidDtIn)
170 {
171 this.measProfValidDt = measProfValidDtIn;
172 }
173
174 private Date measProfQualifDt;
175
176
177
178
179
180 public Date getMeasProfQualifDt()
181 {
182 return this.measProfQualifDt;
183 }
184
185
186
187
188
189 public void setMeasProfQualifDt(Date measProfQualifDtIn)
190 {
191 this.measProfQualifDt = measProfQualifDtIn;
192 }
193
194 private String measProfQualifCm;
195
196
197
198
199
200 public String getMeasProfQualifCm()
201 {
202 return this.measProfQualifCm;
203 }
204
205
206
207
208
209 public void setMeasProfQualifCm(String measProfQualifCmIn)
210 {
211 this.measProfQualifCm = measProfQualifCmIn;
212 }
213
214 private Integer remoteId;
215
216
217
218
219
220 public Integer getRemoteId()
221 {
222 return this.remoteId;
223 }
224
225
226
227
228
229 public void setRemoteId(Integer remoteIdIn)
230 {
231 this.remoteId = remoteIdIn;
232 }
233
234
235 private Collection<Program> programs = new HashSet<Program>();
236
237
238
239
240
241 public Collection<Program> getPrograms()
242 {
243 return this.programs;
244 }
245
246
247
248
249
250 public void setPrograms(Collection<Program> programsIn)
251 {
252 this.programs = programsIn;
253 }
254
255
256
257
258
259
260
261 public boolean addPrograms(Program elementToAdd)
262 {
263 return this.programs.add(elementToAdd);
264 }
265
266
267
268
269
270
271
272 public boolean removePrograms(Program elementToRemove)
273 {
274 return this.programs.remove(elementToRemove);
275 }
276
277 private Survey survey;
278
279
280
281
282
283
284 public Survey getSurvey()
285 {
286 return this.survey;
287 }
288
289
290
291
292
293
294 public void setSurvey(Survey surveyIn)
295 {
296 this.survey = surveyIn;
297 }
298
299 private QualityFlag qualityFlag;
300
301
302
303
304
305 public QualityFlag getQualityFlag()
306 {
307 return this.qualityFlag;
308 }
309
310
311
312
313
314 public void setQualityFlag(QualityFlag qualityFlagIn)
315 {
316 this.qualityFlag = qualityFlagIn;
317 }
318
319 private Department recorderDepartment;
320
321
322
323
324
325 public Department getRecorderDepartment()
326 {
327 return this.recorderDepartment;
328 }
329
330
331
332
333
334 public void setRecorderDepartment(Department recorderDepartmentIn)
335 {
336 this.recorderDepartment = recorderDepartmentIn;
337 }
338
339
340
341
342
343 @Override
344 public boolean equals(Object object)
345 {
346 if (this == object)
347 {
348 return true;
349 }
350 if (!(object instanceof MeasuredProfile))
351 {
352 return false;
353 }
354 final MeasuredProfile that = (MeasuredProfile)object;
355 if (this.measProfId == null || that.getMeasProfId() == null || !this.measProfId.equals(that.getMeasProfId()))
356 {
357 return false;
358 }
359 return true;
360 }
361
362
363
364
365 @Override
366 public int hashCode()
367 {
368 int hashCode = 0;
369 hashCode = 29 * hashCode + (this.measProfId == null ? 0 : this.measProfId.hashCode());
370
371 return hashCode;
372 }
373
374
375
376
377 public static final class Factory
378 {
379
380
381
382
383 public static MeasuredProfile newInstance()
384 {
385 return new MeasuredProfileImpl();
386 }
387
388
389
390
391
392
393
394
395 public static MeasuredProfile newInstance(Date measProfCreationDt, Department recorderDepartment)
396 {
397 final MeasuredProfile entity = new MeasuredProfileImpl();
398 entity.setMeasProfCreationDt(measProfCreationDt);
399 entity.setRecorderDepartment(recorderDepartment);
400 return entity;
401 }
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420 public static MeasuredProfile newInstance(String measProfDc, String measProfUpload, Date measProfCreationDt, Timestamp updateDt, Date measProfValidDt, Date measProfQualifDt, String measProfQualifCm, Integer remoteId, Collection<Program> programs, Survey survey, QualityFlag qualityFlag, Department recorderDepartment)
421 {
422 final MeasuredProfile entity = new MeasuredProfileImpl();
423 entity.setMeasProfDc(measProfDc);
424 entity.setMeasProfUpload(measProfUpload);
425 entity.setMeasProfCreationDt(measProfCreationDt);
426 entity.setUpdateDt(updateDt);
427 entity.setMeasProfValidDt(measProfValidDt);
428 entity.setMeasProfQualifDt(measProfQualifDt);
429 entity.setMeasProfQualifCm(measProfQualifCm);
430 entity.setRemoteId(remoteId);
431 entity.setPrograms(programs);
432 entity.setSurvey(survey);
433 entity.setQualityFlag(qualityFlag);
434 entity.setRecorderDepartment(recorderDepartment);
435 return entity;
436 }
437 }
438
439
440
441
442 public int compareTo(MeasuredProfile o)
443 {
444 int cmp = 0;
445 if (this.getMeasProfId() != null)
446 {
447 cmp = this.getMeasProfId().compareTo(o.getMeasProfId());
448 }
449 else
450 {
451 if (this.getMeasProfDc() != null)
452 {
453 cmp = (cmp != 0 ? cmp : this.getMeasProfDc().compareTo(o.getMeasProfDc()));
454 }
455 if (this.getMeasProfUpload() != null)
456 {
457 cmp = (cmp != 0 ? cmp : this.getMeasProfUpload().compareTo(o.getMeasProfUpload()));
458 }
459 if (this.getMeasProfCreationDt() != null)
460 {
461 cmp = (cmp != 0 ? cmp : this.getMeasProfCreationDt().compareTo(o.getMeasProfCreationDt()));
462 }
463 if (this.getUpdateDt() != null)
464 {
465 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
466 }
467 if (this.getMeasProfValidDt() != null)
468 {
469 cmp = (cmp != 0 ? cmp : this.getMeasProfValidDt().compareTo(o.getMeasProfValidDt()));
470 }
471 if (this.getMeasProfQualifDt() != null)
472 {
473 cmp = (cmp != 0 ? cmp : this.getMeasProfQualifDt().compareTo(o.getMeasProfQualifDt()));
474 }
475 if (this.getMeasProfQualifCm() != null)
476 {
477 cmp = (cmp != 0 ? cmp : this.getMeasProfQualifCm().compareTo(o.getMeasProfQualifCm()));
478 }
479 if (this.getRemoteId() != null)
480 {
481 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
482 }
483 }
484 return cmp;
485 }
486
487
488 }