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