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.Moratorium;
29 import fr.ifremer.quadrige3.core.dao.administration.user.Department;
30 import fr.ifremer.quadrige3.core.dao.administration.user.Quser;
31 import fr.ifremer.quadrige3.core.dao.referential.monitoringLocation.PositionningSystem;
32 import fr.ifremer.quadrige3.core.dao.system.OccasArea;
33 import fr.ifremer.quadrige3.core.dao.system.OccasLine;
34 import fr.ifremer.quadrige3.core.dao.system.OccasPoint;
35 import java.io.Serializable;
36 import java.sql.Timestamp;
37 import java.util.Collection;
38 import java.util.Date;
39 import java.util.HashSet;
40
41
42
43
44
45 public abstract class Occasion
46 implements Serializable, Comparable<Occasion>
47 {
48
49
50
51 private static final long serialVersionUID = -4061238615957494261L;
52
53
54 private Integer occasId;
55
56
57
58
59
60 public Integer getOccasId()
61 {
62 return this.occasId;
63 }
64
65
66
67
68
69 public void setOccasId(Integer occasIdIn)
70 {
71 this.occasId = occasIdIn;
72 }
73
74 private Date occasDt;
75
76
77
78
79
80
81 public Date getOccasDt()
82 {
83 return this.occasDt;
84 }
85
86
87
88
89
90
91 public void setOccasDt(Date occasDtIn)
92 {
93 this.occasDt = occasDtIn;
94 }
95
96 private String occasNm;
97
98
99
100
101
102 public String getOccasNm()
103 {
104 return this.occasNm;
105 }
106
107
108
109
110
111 public void setOccasNm(String occasNmIn)
112 {
113 this.occasNm = occasNmIn;
114 }
115
116 private String occasCm;
117
118
119
120
121
122 public String getOccasCm()
123 {
124 return this.occasCm;
125 }
126
127
128
129
130
131 public void setOccasCm(String occasCmIn)
132 {
133 this.occasCm = occasCmIn;
134 }
135
136 private String occasPositionCm;
137
138
139
140
141
142 public String getOccasPositionCm()
143 {
144 return this.occasPositionCm;
145 }
146
147
148
149
150
151 public void setOccasPositionCm(String occasPositionCmIn)
152 {
153 this.occasPositionCm = occasPositionCmIn;
154 }
155
156 private Timestamp updateDt;
157
158
159
160
161
162 public Timestamp getUpdateDt()
163 {
164 return this.updateDt;
165 }
166
167
168
169
170
171 public void setUpdateDt(Timestamp updateDtIn)
172 {
173 this.updateDt = updateDtIn;
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 Collection<Moratorium> moratoria = new HashSet<Moratorium>();
198
199
200
201
202
203 public Collection<Moratorium> getMoratoria()
204 {
205 return this.moratoria;
206 }
207
208
209
210
211
212 public void setMoratoria(Collection<Moratorium> moratoriaIn)
213 {
214 this.moratoria = moratoriaIn;
215 }
216
217
218
219
220
221
222
223 public boolean addMoratoria(Moratorium elementToAdd)
224 {
225 return this.moratoria.add(elementToAdd);
226 }
227
228
229
230
231
232
233
234 public boolean removeMoratoria(Moratorium elementToRemove)
235 {
236 return this.moratoria.remove(elementToRemove);
237 }
238
239 private Collection<Quser> qusers = new HashSet<Quser>();
240
241
242
243
244
245 public Collection<Quser> getQusers()
246 {
247 return this.qusers;
248 }
249
250
251
252
253
254 public void setQusers(Collection<Quser> qusersIn)
255 {
256 this.qusers = qusersIn;
257 }
258
259
260
261
262
263
264
265 public boolean addQusers(Quser elementToAdd)
266 {
267 return this.qusers.add(elementToAdd);
268 }
269
270
271
272
273
274
275
276 public boolean removeQusers(Quser elementToRemove)
277 {
278 return this.qusers.remove(elementToRemove);
279 }
280
281 private Collection<OccasArea> occasAreas = new HashSet<OccasArea>();
282
283
284
285
286
287 public Collection<OccasArea> getOccasAreas()
288 {
289 return this.occasAreas;
290 }
291
292
293
294
295
296 public void setOccasAreas(Collection<OccasArea> occasAreasIn)
297 {
298 this.occasAreas = occasAreasIn;
299 }
300
301
302
303
304
305
306
307 public boolean addOccasAreas(OccasArea elementToAdd)
308 {
309 return this.occasAreas.add(elementToAdd);
310 }
311
312
313
314
315
316
317
318 public boolean removeOccasAreas(OccasArea elementToRemove)
319 {
320 return this.occasAreas.remove(elementToRemove);
321 }
322
323 private Collection<OccasPoint> occasPoints = new HashSet<OccasPoint>();
324
325
326
327
328
329 public Collection<OccasPoint> getOccasPoints()
330 {
331 return this.occasPoints;
332 }
333
334
335
336
337
338 public void setOccasPoints(Collection<OccasPoint> occasPointsIn)
339 {
340 this.occasPoints = occasPointsIn;
341 }
342
343
344
345
346
347
348
349 public boolean addOccasPoints(OccasPoint elementToAdd)
350 {
351 return this.occasPoints.add(elementToAdd);
352 }
353
354
355
356
357
358
359
360 public boolean removeOccasPoints(OccasPoint elementToRemove)
361 {
362 return this.occasPoints.remove(elementToRemove);
363 }
364
365 private Department recorderDepartment;
366
367
368
369
370
371 public Department getRecorderDepartment()
372 {
373 return this.recorderDepartment;
374 }
375
376
377
378
379
380 public void setRecorderDepartment(Department recorderDepartmentIn)
381 {
382 this.recorderDepartment = recorderDepartmentIn;
383 }
384
385 private Campaign campaign;
386
387
388
389
390
391 public Campaign getCampaign()
392 {
393 return this.campaign;
394 }
395
396
397
398
399
400 public void setCampaign(Campaign campaignIn)
401 {
402 this.campaign = campaignIn;
403 }
404
405 private Collection<OccasLine> occasLines = new HashSet<OccasLine>();
406
407
408
409
410
411 public Collection<OccasLine> getOccasLines()
412 {
413 return this.occasLines;
414 }
415
416
417
418
419
420 public void setOccasLines(Collection<OccasLine> occasLinesIn)
421 {
422 this.occasLines = occasLinesIn;
423 }
424
425
426
427
428
429
430
431 public boolean addOccasLines(OccasLine elementToAdd)
432 {
433 return this.occasLines.add(elementToAdd);
434 }
435
436
437
438
439
440
441
442 public boolean removeOccasLines(OccasLine elementToRemove)
443 {
444 return this.occasLines.remove(elementToRemove);
445 }
446
447 private PositionningSystem positionningSystem;
448
449
450
451
452
453 public PositionningSystem getPositionningSystem()
454 {
455 return this.positionningSystem;
456 }
457
458
459
460
461
462 public void setPositionningSystem(PositionningSystem positionningSystemIn)
463 {
464 this.positionningSystem = positionningSystemIn;
465 }
466
467 private Ship ship;
468
469
470
471
472
473 public Ship getShip()
474 {
475 return this.ship;
476 }
477
478
479
480
481
482 public void setShip(Ship shipIn)
483 {
484 this.ship = shipIn;
485 }
486
487
488
489
490
491 @Override
492 public boolean equals(Object object)
493 {
494 if (this == object)
495 {
496 return true;
497 }
498 if (!(object instanceof Occasion))
499 {
500 return false;
501 }
502 final Occasion that = (Occasion)object;
503 if (this.occasId == null || that.getOccasId() == null || !this.occasId.equals(that.getOccasId()))
504 {
505 return false;
506 }
507 return true;
508 }
509
510
511
512
513 @Override
514 public int hashCode()
515 {
516 int hashCode = 0;
517 hashCode = 29 * hashCode + (this.occasId == null ? 0 : this.occasId.hashCode());
518
519 return hashCode;
520 }
521
522
523
524
525 public static final class Factory
526 {
527
528
529
530
531 public static Occasion newInstance()
532 {
533 return new OccasionImpl();
534 }
535
536
537
538
539
540
541
542
543
544
545 public static Occasion newInstance(Date occasDt, String occasNm, Department recorderDepartment, Campaign campaign)
546 {
547 final Occasion entity = new OccasionImpl();
548 entity.setOccasDt(occasDt);
549 entity.setOccasNm(occasNm);
550 entity.setRecorderDepartment(recorderDepartment);
551 entity.setCampaign(campaign);
552 return entity;
553 }
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575 public static Occasion newInstance(Date occasDt, String occasNm, String occasCm, String occasPositionCm, Timestamp updateDt, Integer remoteId, Collection<Moratorium> moratoria, Collection<Quser> qusers, Collection<OccasArea> occasAreas, Collection<OccasPoint> occasPoints, Department recorderDepartment, Campaign campaign, Collection<OccasLine> occasLines, PositionningSystem positionningSystem, Ship ship)
576 {
577 final Occasion entity = new OccasionImpl();
578 entity.setOccasDt(occasDt);
579 entity.setOccasNm(occasNm);
580 entity.setOccasCm(occasCm);
581 entity.setOccasPositionCm(occasPositionCm);
582 entity.setUpdateDt(updateDt);
583 entity.setRemoteId(remoteId);
584 entity.setMoratoria(moratoria);
585 entity.setQusers(qusers);
586 entity.setOccasAreas(occasAreas);
587 entity.setOccasPoints(occasPoints);
588 entity.setRecorderDepartment(recorderDepartment);
589 entity.setCampaign(campaign);
590 entity.setOccasLines(occasLines);
591 entity.setPositionningSystem(positionningSystem);
592 entity.setShip(ship);
593 return entity;
594 }
595 }
596
597
598
599
600 public int compareTo(Occasion o)
601 {
602 int cmp = 0;
603 if (this.getOccasId() != null)
604 {
605 cmp = this.getOccasId().compareTo(o.getOccasId());
606 }
607 else
608 {
609 if (this.getOccasDt() != null)
610 {
611 cmp = (cmp != 0 ? cmp : this.getOccasDt().compareTo(o.getOccasDt()));
612 }
613 if (this.getOccasNm() != null)
614 {
615 cmp = (cmp != 0 ? cmp : this.getOccasNm().compareTo(o.getOccasNm()));
616 }
617 if (this.getOccasCm() != null)
618 {
619 cmp = (cmp != 0 ? cmp : this.getOccasCm().compareTo(o.getOccasCm()));
620 }
621 if (this.getOccasPositionCm() != null)
622 {
623 cmp = (cmp != 0 ? cmp : this.getOccasPositionCm().compareTo(o.getOccasPositionCm()));
624 }
625 if (this.getUpdateDt() != null)
626 {
627 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
628 }
629 if (this.getRemoteId() != null)
630 {
631 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
632 }
633 }
634 return cmp;
635 }
636
637
638 }