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.program.Program;
30 import fr.ifremer.quadrige3.core.dao.administration.user.Department;
31 import fr.ifremer.quadrige3.core.dao.administration.user.Quser;
32 import fr.ifremer.quadrige3.core.dao.referential.monitoringLocation.PositionningSystem;
33 import fr.ifremer.quadrige3.core.dao.system.CampaignArea;
34 import fr.ifremer.quadrige3.core.dao.system.CampaignLine;
35 import fr.ifremer.quadrige3.core.dao.system.CampaignPoint;
36 import java.io.Serializable;
37 import java.sql.Timestamp;
38 import java.util.Collection;
39 import java.util.Date;
40 import java.util.HashSet;
41
42
43
44
45
46 public abstract class Campaign
47 implements Serializable, Comparable<Campaign>
48 {
49
50
51
52 private static final long serialVersionUID = -7823753622861992792L;
53
54
55 private Integer campaignId;
56
57
58
59
60
61 public Integer getCampaignId()
62 {
63 return this.campaignId;
64 }
65
66
67
68
69
70 public void setCampaignId(Integer campaignIdIn)
71 {
72 this.campaignId = campaignIdIn;
73 }
74
75 private String campaignSismerLk;
76
77
78
79
80
81
82 public String getCampaignSismerLk()
83 {
84 return this.campaignSismerLk;
85 }
86
87
88
89
90
91
92 public void setCampaignSismerLk(String campaignSismerLkIn)
93 {
94 this.campaignSismerLk = campaignSismerLkIn;
95 }
96
97 private Date campaignStartDt;
98
99
100
101
102
103 public Date getCampaignStartDt()
104 {
105 return this.campaignStartDt;
106 }
107
108
109
110
111
112 public void setCampaignStartDt(Date campaignStartDtIn)
113 {
114 this.campaignStartDt = campaignStartDtIn;
115 }
116
117 private Date campaignEndDt;
118
119
120
121
122
123 public Date getCampaignEndDt()
124 {
125 return this.campaignEndDt;
126 }
127
128
129
130
131
132 public void setCampaignEndDt(Date campaignEndDtIn)
133 {
134 this.campaignEndDt = campaignEndDtIn;
135 }
136
137 private String campaignNm;
138
139
140
141
142
143 public String getCampaignNm()
144 {
145 return this.campaignNm;
146 }
147
148
149
150
151
152 public void setCampaignNm(String campaignNmIn)
153 {
154 this.campaignNm = campaignNmIn;
155 }
156
157 private String campaignCm;
158
159
160
161
162
163 public String getCampaignCm()
164 {
165 return this.campaignCm;
166 }
167
168
169
170
171
172 public void setCampaignCm(String campaignCmIn)
173 {
174 this.campaignCm = campaignCmIn;
175 }
176
177 private String campaignPositionCm;
178
179
180
181
182
183 public String getCampaignPositionCm()
184 {
185 return this.campaignPositionCm;
186 }
187
188
189
190
191
192 public void setCampaignPositionCm(String campaignPositionCmIn)
193 {
194 this.campaignPositionCm = campaignPositionCmIn;
195 }
196
197 private Timestamp updateDt;
198
199
200
201
202
203 public Timestamp getUpdateDt()
204 {
205 return this.updateDt;
206 }
207
208
209
210
211
212 public void setUpdateDt(Timestamp updateDtIn)
213 {
214 this.updateDt = updateDtIn;
215 }
216
217 private Integer remoteId;
218
219
220
221
222
223 public Integer getRemoteId()
224 {
225 return this.remoteId;
226 }
227
228
229
230
231
232 public void setRemoteId(Integer remoteIdIn)
233 {
234 this.remoteId = remoteIdIn;
235 }
236
237
238 private Collection<Moratorium> moratoria = new HashSet<Moratorium>();
239
240
241
242
243
244 public Collection<Moratorium> getMoratoria()
245 {
246 return this.moratoria;
247 }
248
249
250
251
252
253 public void setMoratoria(Collection<Moratorium> moratoriaIn)
254 {
255 this.moratoria = moratoriaIn;
256 }
257
258
259
260
261
262
263
264 public boolean addMoratoria(Moratorium elementToAdd)
265 {
266 return this.moratoria.add(elementToAdd);
267 }
268
269
270
271
272
273
274
275 public boolean removeMoratoria(Moratorium elementToRemove)
276 {
277 return this.moratoria.remove(elementToRemove);
278 }
279
280 private Collection<CampaignPoint> campaignPoints = new HashSet<CampaignPoint>();
281
282
283
284
285
286 public Collection<CampaignPoint> getCampaignPoints()
287 {
288 return this.campaignPoints;
289 }
290
291
292
293
294
295 public void setCampaignPoints(Collection<CampaignPoint> campaignPointsIn)
296 {
297 this.campaignPoints = campaignPointsIn;
298 }
299
300
301
302
303
304
305
306 public boolean addCampaignPoints(CampaignPoint elementToAdd)
307 {
308 return this.campaignPoints.add(elementToAdd);
309 }
310
311
312
313
314
315
316
317 public boolean removeCampaignPoints(CampaignPoint elementToRemove)
318 {
319 return this.campaignPoints.remove(elementToRemove);
320 }
321
322 private Quser quser;
323
324
325
326
327
328 public Quser getQuser()
329 {
330 return this.quser;
331 }
332
333
334
335
336
337 public void setQuser(Quser quserIn)
338 {
339 this.quser = quserIn;
340 }
341
342 private Collection<Program> programs = new HashSet<Program>();
343
344
345
346
347
348 public Collection<Program> getPrograms()
349 {
350 return this.programs;
351 }
352
353
354
355
356
357 public void setPrograms(Collection<Program> programsIn)
358 {
359 this.programs = programsIn;
360 }
361
362
363
364
365
366
367
368 public boolean addPrograms(Program elementToAdd)
369 {
370 return this.programs.add(elementToAdd);
371 }
372
373
374
375
376
377
378
379 public boolean removePrograms(Program elementToRemove)
380 {
381 return this.programs.remove(elementToRemove);
382 }
383
384 private Ship ship;
385
386
387
388
389
390 public Ship getShip()
391 {
392 return this.ship;
393 }
394
395
396
397
398
399 public void setShip(Ship shipIn)
400 {
401 this.ship = shipIn;
402 }
403
404 private Collection<Occasion> occasions = new HashSet<Occasion>();
405
406
407
408
409
410 public Collection<Occasion> getOccasions()
411 {
412 return this.occasions;
413 }
414
415
416
417
418
419 public void setOccasions(Collection<Occasion> occasionsIn)
420 {
421 this.occasions = occasionsIn;
422 }
423
424
425
426
427
428
429
430 public boolean addOccasions(Occasion elementToAdd)
431 {
432 return this.occasions.add(elementToAdd);
433 }
434
435
436
437
438
439
440
441 public boolean removeOccasions(Occasion elementToRemove)
442 {
443 return this.occasions.remove(elementToRemove);
444 }
445
446 private PositionningSystem positionningSystem;
447
448
449
450
451
452 public PositionningSystem getPositionningSystem()
453 {
454 return this.positionningSystem;
455 }
456
457
458
459
460
461 public void setPositionningSystem(PositionningSystem positionningSystemIn)
462 {
463 this.positionningSystem = positionningSystemIn;
464 }
465
466 private Collection<CampaignLine> campaignLines = new HashSet<CampaignLine>();
467
468
469
470
471
472 public Collection<CampaignLine> getCampaignLines()
473 {
474 return this.campaignLines;
475 }
476
477
478
479
480
481 public void setCampaignLines(Collection<CampaignLine> campaignLinesIn)
482 {
483 this.campaignLines = campaignLinesIn;
484 }
485
486
487
488
489
490
491
492 public boolean addCampaignLines(CampaignLine elementToAdd)
493 {
494 return this.campaignLines.add(elementToAdd);
495 }
496
497
498
499
500
501
502
503 public boolean removeCampaignLines(CampaignLine elementToRemove)
504 {
505 return this.campaignLines.remove(elementToRemove);
506 }
507
508 private Department recorderDepartment;
509
510
511
512
513
514 public Department getRecorderDepartment()
515 {
516 return this.recorderDepartment;
517 }
518
519
520
521
522
523 public void setRecorderDepartment(Department recorderDepartmentIn)
524 {
525 this.recorderDepartment = recorderDepartmentIn;
526 }
527
528 private Collection<CampaignArea> campaignAreas = new HashSet<CampaignArea>();
529
530
531
532
533
534 public Collection<CampaignArea> getCampaignAreas()
535 {
536 return this.campaignAreas;
537 }
538
539
540
541
542
543 public void setCampaignAreas(Collection<CampaignArea> campaignAreasIn)
544 {
545 this.campaignAreas = campaignAreasIn;
546 }
547
548
549
550
551
552
553
554 public boolean addCampaignAreas(CampaignArea elementToAdd)
555 {
556 return this.campaignAreas.add(elementToAdd);
557 }
558
559
560
561
562
563
564
565 public boolean removeCampaignAreas(CampaignArea elementToRemove)
566 {
567 return this.campaignAreas.remove(elementToRemove);
568 }
569
570
571
572
573
574 @Override
575 public boolean equals(Object object)
576 {
577 if (this == object)
578 {
579 return true;
580 }
581 if (!(object instanceof Campaign))
582 {
583 return false;
584 }
585 final Campaign that = (Campaign)object;
586 if (this.campaignId == null || that.getCampaignId() == null || !this.campaignId.equals(that.getCampaignId()))
587 {
588 return false;
589 }
590 return true;
591 }
592
593
594
595
596 @Override
597 public int hashCode()
598 {
599 int hashCode = 0;
600 hashCode = 29 * hashCode + (this.campaignId == null ? 0 : this.campaignId.hashCode());
601
602 return hashCode;
603 }
604
605
606
607
608 public static final class Factory
609 {
610
611
612
613
614 public static Campaign newInstance()
615 {
616 return new CampaignImpl();
617 }
618
619
620
621
622
623
624
625
626
627
628 public static Campaign newInstance(Date campaignStartDt, String campaignNm, Quser quser, Department recorderDepartment)
629 {
630 final Campaign entity = new CampaignImpl();
631 entity.setCampaignStartDt(campaignStartDt);
632 entity.setCampaignNm(campaignNm);
633 entity.setQuser(quser);
634 entity.setRecorderDepartment(recorderDepartment);
635 return entity;
636 }
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661 public static Campaign newInstance(String campaignSismerLk, Date campaignStartDt, Date campaignEndDt, String campaignNm, String campaignCm, String campaignPositionCm, Timestamp updateDt, Integer remoteId, Collection<Moratorium> moratoria, Collection<CampaignPoint> campaignPoints, Quser quser, Collection<Program> programs, Ship ship, Collection<Occasion> occasions, PositionningSystem positionningSystem, Collection<CampaignLine> campaignLines, Department recorderDepartment, Collection<CampaignArea> campaignAreas)
662 {
663 final Campaign entity = new CampaignImpl();
664 entity.setCampaignSismerLk(campaignSismerLk);
665 entity.setCampaignStartDt(campaignStartDt);
666 entity.setCampaignEndDt(campaignEndDt);
667 entity.setCampaignNm(campaignNm);
668 entity.setCampaignCm(campaignCm);
669 entity.setCampaignPositionCm(campaignPositionCm);
670 entity.setUpdateDt(updateDt);
671 entity.setRemoteId(remoteId);
672 entity.setMoratoria(moratoria);
673 entity.setCampaignPoints(campaignPoints);
674 entity.setQuser(quser);
675 entity.setPrograms(programs);
676 entity.setShip(ship);
677 entity.setOccasions(occasions);
678 entity.setPositionningSystem(positionningSystem);
679 entity.setCampaignLines(campaignLines);
680 entity.setRecorderDepartment(recorderDepartment);
681 entity.setCampaignAreas(campaignAreas);
682 return entity;
683 }
684 }
685
686
687
688
689 public int compareTo(Campaign o)
690 {
691 int cmp = 0;
692 if (this.getCampaignId() != null)
693 {
694 cmp = this.getCampaignId().compareTo(o.getCampaignId());
695 }
696 else
697 {
698 if (this.getCampaignSismerLk() != null)
699 {
700 cmp = (cmp != 0 ? cmp : this.getCampaignSismerLk().compareTo(o.getCampaignSismerLk()));
701 }
702 if (this.getCampaignStartDt() != null)
703 {
704 cmp = (cmp != 0 ? cmp : this.getCampaignStartDt().compareTo(o.getCampaignStartDt()));
705 }
706 if (this.getCampaignEndDt() != null)
707 {
708 cmp = (cmp != 0 ? cmp : this.getCampaignEndDt().compareTo(o.getCampaignEndDt()));
709 }
710 if (this.getCampaignNm() != null)
711 {
712 cmp = (cmp != 0 ? cmp : this.getCampaignNm().compareTo(o.getCampaignNm()));
713 }
714 if (this.getCampaignCm() != null)
715 {
716 cmp = (cmp != 0 ? cmp : this.getCampaignCm().compareTo(o.getCampaignCm()));
717 }
718 if (this.getCampaignPositionCm() != null)
719 {
720 cmp = (cmp != 0 ? cmp : this.getCampaignPositionCm().compareTo(o.getCampaignPositionCm()));
721 }
722 if (this.getUpdateDt() != null)
723 {
724 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
725 }
726 if (this.getRemoteId() != null)
727 {
728 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
729 }
730 }
731 return cmp;
732 }
733
734
735 }