1 // license-header java merge-point
2 //
3 // Attention: Generated code! Do not modify by hand!
4 // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
5 //
6 package fr.ifremer.quadrige2.core.dao.data.survey;
7
8 /*-
9 * #%L
10 * Quadrige2 Core :: Server API
11 * %%
12 * Copyright (C) 2017 Ifremer
13 * %%
14 * This program is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Affero General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU Affero General Public License
25 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 * #L%
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 * Liste des sorties effectuées lors d'une campagne.
44 */
45 // HibernateEntity.vsl annotations merge-point
46 public abstract class Occasion
47 implements Serializable, Comparable<Occasion>
48 {
49 /**
50 * The serial version UID of this class. Needed for serialization.
51 */
52 private static final long serialVersionUID = 5983376992885462272L;
53
54 // Generate 6 attributes
55 private Integer occasId;
56
57 /**
58 * Identifiant interne de la sortie
59 * @return this.occasId Integer
60 */
61 public Integer getOccasId()
62 {
63 return this.occasId;
64 }
65
66 /**
67 * Identifiant interne de la sortie
68 * @param occasIdIn Integer
69 */
70 public void setOccasId(Integer occasIdIn)
71 {
72 this.occasId = occasIdIn;
73 }
74
75 private Date occasDt;
76
77 /**
78 * Date et heure de la sortie.
79 * L'heure n'est pas obligatoire, par défaut 00:00:00
80 * @return this.occasDt Date
81 */
82 public Date getOccasDt()
83 {
84 return this.occasDt;
85 }
86
87 /**
88 * Date et heure de la sortie.
89 * L'heure n'est pas obligatoire, par défaut 00:00:00
90 * @param occasDtIn Date
91 */
92 public void setOccasDt(Date occasDtIn)
93 {
94 this.occasDt = occasDtIn;
95 }
96
97 private String occasNm;
98
99 /**
100 * Llibellé décrivant la sortie
101 * @return this.occasNm String
102 */
103 public String getOccasNm()
104 {
105 return this.occasNm;
106 }
107
108 /**
109 * Llibellé décrivant la sortie
110 * @param occasNmIn String
111 */
112 public void setOccasNm(String occasNmIn)
113 {
114 this.occasNm = occasNmIn;
115 }
116
117 private String occasCm;
118
119 /**
120 * Commentaire sur la sortie
121 * @return this.occasCm String
122 */
123 public String getOccasCm()
124 {
125 return this.occasCm;
126 }
127
128 /**
129 * Commentaire sur la sortie
130 * @param occasCmIn String
131 */
132 public void setOccasCm(String occasCmIn)
133 {
134 this.occasCm = occasCmIn;
135 }
136
137 private String occasPositionCm;
138
139 /**
140 * Commentaire décrivant la localisation de la sortie
141 * @return this.occasPositionCm String
142 */
143 public String getOccasPositionCm()
144 {
145 return this.occasPositionCm;
146 }
147
148 /**
149 * Commentaire décrivant la localisation de la sortie
150 * @param occasPositionCmIn String
151 */
152 public void setOccasPositionCm(String occasPositionCmIn)
153 {
154 this.occasPositionCm = occasPositionCmIn;
155 }
156
157 private Timestamp updateDt;
158
159 /**
160 * Date de modification de l'objet, mise à jour par le système
161 * @return this.updateDt Timestamp
162 */
163 public Timestamp getUpdateDt()
164 {
165 return this.updateDt;
166 }
167
168 /**
169 * Date de modification de l'objet, mise à jour par le système
170 * @param updateDtIn Timestamp
171 */
172 public void setUpdateDt(Timestamp updateDtIn)
173 {
174 this.updateDt = updateDtIn;
175 }
176
177 // Generate 10 associations
178 private Collection<Moratorium> moratoria = new HashSet<Moratorium>();
179
180 /**
181 * Moratoire sur la restriction d'accès aux données
182 * @return this.moratoria Collection<Moratorium>
183 */
184 public Collection<Moratorium> getMoratoria()
185 {
186 return this.moratoria;
187 }
188
189 /**
190 * Moratoire sur la restriction d'accès aux données
191 * @param moratoriaIn Collection<Moratorium>
192 */
193 public void setMoratoria(Collection<Moratorium> moratoriaIn)
194 {
195 this.moratoria = moratoriaIn;
196 }
197
198 /**
199 * Moratoire sur la restriction d'accès aux données
200 * @param elementToAdd Moratorium
201 * @return <tt>true</tt> if this collection changed as a result of the
202 * call
203 */
204 public boolean addMoratoria(Moratorium elementToAdd)
205 {
206 return this.moratoria.add(elementToAdd);
207 }
208
209 /**
210 * Moratoire sur la restriction d'accès aux données
211 * @param elementToRemove Moratorium
212 * @return <tt>true</tt> if this collection changed as a result of the
213 * call
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 * Liste l'ensemble des agents et utilisateurs du système.
224 * @return this.qusers Collection<Quser>
225 */
226 public Collection<Quser> getQusers()
227 {
228 return this.qusers;
229 }
230
231 /**
232 * Liste l'ensemble des agents et utilisateurs du système.
233 * @param qusersIn Collection<Quser>
234 */
235 public void setQusers(Collection<Quser> qusersIn)
236 {
237 this.qusers = qusersIn;
238 }
239
240 /**
241 * Liste l'ensemble des agents et utilisateurs du système.
242 * @param elementToAdd Quser
243 * @return <tt>true</tt> if this collection changed as a result of the
244 * call
245 */
246 public boolean addQusers(Quser elementToAdd)
247 {
248 return this.qusers.add(elementToAdd);
249 }
250
251 /**
252 * Liste l'ensemble des agents et utilisateurs du système.
253 * @param elementToRemove Quser
254 * @return <tt>true</tt> if this collection changed as a result of the
255 * call
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 * Gestion de la géométrie surfacique des sorties.
266 * @return this.occasAreas Collection<OccasArea>
267 */
268 public Collection<OccasArea> getOccasAreas()
269 {
270 return this.occasAreas;
271 }
272
273 /**
274 * Gestion de la géométrie surfacique des sorties.
275 * @param occasAreasIn Collection<OccasArea>
276 */
277 public void setOccasAreas(Collection<OccasArea> occasAreasIn)
278 {
279 this.occasAreas = occasAreasIn;
280 }
281
282 /**
283 * Gestion de la géométrie surfacique des sorties.
284 * @param elementToAdd OccasArea
285 * @return <tt>true</tt> if this collection changed as a result of the
286 * call
287 */
288 public boolean addOccasAreas(OccasArea elementToAdd)
289 {
290 return this.occasAreas.add(elementToAdd);
291 }
292
293 /**
294 * Gestion de la géométrie surfacique des sorties.
295 * @param elementToRemove OccasArea
296 * @return <tt>true</tt> if this collection changed as a result of the
297 * call
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 * Gestion de la géométrie ponctuelle des sorties.
308 * @return this.occasPoints Collection<OccasPoint>
309 */
310 public Collection<OccasPoint> getOccasPoints()
311 {
312 return this.occasPoints;
313 }
314
315 /**
316 * Gestion de la géométrie ponctuelle des sorties.
317 * @param occasPointsIn Collection<OccasPoint>
318 */
319 public void setOccasPoints(Collection<OccasPoint> occasPointsIn)
320 {
321 this.occasPoints = occasPointsIn;
322 }
323
324 /**
325 * Gestion de la géométrie ponctuelle des sorties.
326 * @param elementToAdd OccasPoint
327 * @return <tt>true</tt> if this collection changed as a result of the
328 * call
329 */
330 public boolean addOccasPoints(OccasPoint elementToAdd)
331 {
332 return this.occasPoints.add(elementToAdd);
333 }
334
335 /**
336 * Gestion de la géométrie ponctuelle des sorties.
337 * @param elementToRemove OccasPoint
338 * @return <tt>true</tt> if this collection changed as a result of the
339 * call
340 */
341 public boolean removeOccasPoints(OccasPoint elementToRemove)
342 {
343 return this.occasPoints.remove(elementToRemove);
344 }
345
346 private Department recorderDepartment;
347
348 /**
349 * Liste les départements ou services auxquels sont rattachés les agents
350 * @return this.recorderDepartment Department
351 */
352 public Department getRecorderDepartment()
353 {
354 return this.recorderDepartment;
355 }
356
357 /**
358 * Liste les départements ou services auxquels sont rattachés les agents
359 * @param recorderDepartmentIn Department
360 */
361 public void setRecorderDepartment(Department recorderDepartmentIn)
362 {
363 this.recorderDepartment = recorderDepartmentIn;
364 }
365
366 private Campaign campaign;
367
368 /**
369 * Liste des campagnes.
370 * @return this.campaign Campaign
371 */
372 public Campaign getCampaign()
373 {
374 return this.campaign;
375 }
376
377 /**
378 * Liste des campagnes.
379 * @param campaignIn Campaign
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 * Gestion de la géométrie linéaire des sorties.
390 * @return this.occasLines Collection<OccasLine>
391 */
392 public Collection<OccasLine> getOccasLines()
393 {
394 return this.occasLines;
395 }
396
397 /**
398 * Gestion de la géométrie linéaire des sorties.
399 * @param occasLinesIn Collection<OccasLine>
400 */
401 public void setOccasLines(Collection<OccasLine> occasLinesIn)
402 {
403 this.occasLines = occasLinesIn;
404 }
405
406 /**
407 * Gestion de la géométrie linéaire des sorties.
408 * @param elementToAdd OccasLine
409 * @return <tt>true</tt> if this collection changed as a result of the
410 * call
411 */
412 public boolean addOccasLines(OccasLine elementToAdd)
413 {
414 return this.occasLines.add(elementToAdd);
415 }
416
417 /**
418 * Gestion de la géométrie linéaire des sorties.
419 * @param elementToRemove OccasLine
420 * @return <tt>true</tt> if this collection changed as a result of the
421 * call
422 */
423 public boolean removeOccasLines(OccasLine elementToRemove)
424 {
425 return this.occasLines.remove(elementToRemove);
426 }
427
428 private PositionningSystem positionningSystem;
429
430 /**
431 * Informations complémentaires sur le positionnement d'un objet.
432 * @return this.positionningSystem PositionningSystem
433 */
434 public PositionningSystem getPositionningSystem()
435 {
436 return this.positionningSystem;
437 }
438
439 /**
440 * Informations complémentaires sur le positionnement d'un objet.
441 * @param positionningSystemIn PositionningSystem
442 */
443 public void setPositionningSystem(PositionningSystem positionningSystemIn)
444 {
445 this.positionningSystem = positionningSystemIn;
446 }
447
448 private Ship ship;
449
450 /**
451 * Liste des navires intervenant dans les campagnes ou sorties Quadrige2.
452 * @return this.ship Ship
453 */
454 public Ship getShip()
455 {
456 return this.ship;
457 }
458
459 /**
460 * Liste des navires intervenant dans les campagnes ou sorties Quadrige2.
461 * @param shipIn Ship
462 */
463 public void setShip(Ship shipIn)
464 {
465 this.ship = shipIn;
466 }
467
468 /**
469 * Returns <code>true</code> if the argument is an Occasion instance and all identifiers for this entity
470 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
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 * Returns a hash code based on this entity's identifiers.
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 * Constructs new instances of {@link Occasion}.
505 */
506 public static final class Factory
507 {
508 /**
509 * Constructs a new instance of {@link Occasion}.
510 * @return new OccasionImpl()
511 */
512 public static Occasion newInstance()
513 {
514 return new OccasionImpl();
515 }
516
517 /**
518 * Constructs a new instance of {@link Occasion}, taking all required and/or
519 * read-only properties as arguments, except for identifiers.
520 * @param occasDt Date
521 * @param occasNm String
522 * @param updateDt Timestamp
523 * @param recorderDepartment Department
524 * @param campaign Campaign
525 * @return newInstance
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 * Constructs a new instance of {@link Occasion}, taking all possible properties
540 * (except the identifier(s))as arguments.
541 * @param occasDt Date
542 * @param occasNm String
543 * @param occasCm String
544 * @param occasPositionCm String
545 * @param updateDt Timestamp
546 * @param moratoria Collection<Moratorium>
547 * @param qusers Collection<Quser>
548 * @param occasAreas Collection<OccasArea>
549 * @param occasPoints Collection<OccasPoint>
550 * @param recorderDepartment Department
551 * @param campaign Campaign
552 * @param occasLines Collection<OccasLine>
553 * @param positionningSystem PositionningSystem
554 * @param ship Ship
555 * @return newInstance Occasion
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 * @see Comparable#compareTo
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 // HibernateEntity.vsl merge-point
614 // Occasion.java merge-point
615 }