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