View Javadoc
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.quadrige3.core.dao.data.survey;
7   
8   /*-
9    * #%L
10   * Quadrige3 Core :: Client API
11   * %%
12   * Copyright (C) 2017 - 2024 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  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   * Liste des sorties effectuées lors d'une campagne.
43   */
44  // HibernateEntity.vsl annotations merge-point
45  public abstract class Occasion
46      implements Serializable, Comparable<Occasion>
47  {
48      /**
49       * The serial version UID of this class. Needed for serialization.
50       */
51      private static final long serialVersionUID = -4061238615957494261L;
52  
53      // Generate 7 attributes
54      private Integer occasId;
55  
56      /**
57       * Identifiant interne de la sortie
58       * @return this.occasId Integer
59       */
60      public Integer getOccasId()
61      {
62          return this.occasId;
63      }
64  
65      /**
66       * Identifiant interne de la sortie
67       * @param occasIdIn Integer
68       */
69      public void setOccasId(Integer occasIdIn)
70      {
71          this.occasId = occasIdIn;
72      }
73  
74      private Date occasDt;
75  
76      /**
77       * Date et heure de la sortie.
78       * L'heure n'est pas obligatoire, par défaut 00:00:00
79       * @return this.occasDt Date
80       */
81      public Date getOccasDt()
82      {
83          return this.occasDt;
84      }
85  
86      /**
87       * Date et heure de la sortie.
88       * L'heure n'est pas obligatoire, par défaut 00:00:00
89       * @param occasDtIn Date
90       */
91      public void setOccasDt(Date occasDtIn)
92      {
93          this.occasDt = occasDtIn;
94      }
95  
96      private String occasNm;
97  
98      /**
99       * Llibellé décrivant la sortie
100      * @return this.occasNm String
101      */
102     public String getOccasNm()
103     {
104         return this.occasNm;
105     }
106 
107     /**
108      * Llibellé décrivant la sortie
109      * @param occasNmIn String
110      */
111     public void setOccasNm(String occasNmIn)
112     {
113         this.occasNm = occasNmIn;
114     }
115 
116     private String occasCm;
117 
118     /**
119      * Commentaire sur la sortie
120      * @return this.occasCm String
121      */
122     public String getOccasCm()
123     {
124         return this.occasCm;
125     }
126 
127     /**
128      * Commentaire sur la sortie
129      * @param occasCmIn String
130      */
131     public void setOccasCm(String occasCmIn)
132     {
133         this.occasCm = occasCmIn;
134     }
135 
136     private String occasPositionCm;
137 
138     /**
139      * Commentaire décrivant la localisation de la sortie
140      * @return this.occasPositionCm String
141      */
142     public String getOccasPositionCm()
143     {
144         return this.occasPositionCm;
145     }
146 
147     /**
148      * Commentaire décrivant la localisation de la sortie
149      * @param occasPositionCmIn String
150      */
151     public void setOccasPositionCm(String occasPositionCmIn)
152     {
153         this.occasPositionCm = occasPositionCmIn;
154     }
155 
156     private Timestamp updateDt;
157 
158     /**
159      * Date de modification de l'objet, mise à jour par le système
160      * @return this.updateDt Timestamp
161      */
162     public Timestamp getUpdateDt()
163     {
164         return this.updateDt;
165     }
166 
167     /**
168      * Date de modification de l'objet, mise à jour par le système
169      * @param updateDtIn Timestamp
170      */
171     public void setUpdateDt(Timestamp updateDtIn)
172     {
173         this.updateDt = updateDtIn;
174     }
175 
176     private Integer remoteId;
177 
178     /**
179      * 
180      * @return this.remoteId Integer
181      */
182     public Integer getRemoteId()
183     {
184         return this.remoteId;
185     }
186 
187     /**
188      * 
189      * @param remoteIdIn Integer
190      */
191     public void setRemoteId(Integer remoteIdIn)
192     {
193         this.remoteId = remoteIdIn;
194     }
195 
196     // Generate 10 associations
197     private Collection<Moratorium> moratoria = new HashSet<Moratorium>();
198 
199     /**
200      * Moratoire sur la restriction d'accès aux données
201      * @return this.moratoria Collection<Moratorium>
202      */
203     public Collection<Moratorium> getMoratoria()
204     {
205         return this.moratoria;
206     }
207 
208     /**
209      * Moratoire sur la restriction d'accès aux données
210      * @param moratoriaIn Collection<Moratorium>
211      */
212     public void setMoratoria(Collection<Moratorium> moratoriaIn)
213     {
214         this.moratoria = moratoriaIn;
215     }
216 
217     /**
218      * Moratoire sur la restriction d'accès aux données
219      * @param elementToAdd Moratorium
220      * @return <tt>true</tt> if this collection changed as a result of the
221      *         call
222      */
223     public boolean addMoratoria(Moratorium elementToAdd)
224     {
225         return this.moratoria.add(elementToAdd);
226     }
227 
228     /**
229      * Moratoire sur la restriction d'accès aux données
230      * @param elementToRemove Moratorium
231      * @return <tt>true</tt> if this collection changed as a result of the
232      *         call
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      * Liste l'ensemble des agents et utilisateurs du système.
243      * @return this.qusers Collection<Quser>
244      */
245     public Collection<Quser> getQusers()
246     {
247         return this.qusers;
248     }
249 
250     /**
251      * Liste l'ensemble des agents et utilisateurs du système.
252      * @param qusersIn Collection<Quser>
253      */
254     public void setQusers(Collection<Quser> qusersIn)
255     {
256         this.qusers = qusersIn;
257     }
258 
259     /**
260      * Liste l'ensemble des agents et utilisateurs du système.
261      * @param elementToAdd Quser
262      * @return <tt>true</tt> if this collection changed as a result of the
263      *         call
264      */
265     public boolean addQusers(Quser elementToAdd)
266     {
267         return this.qusers.add(elementToAdd);
268     }
269 
270     /**
271      * Liste l'ensemble des agents et utilisateurs du système.
272      * @param elementToRemove Quser
273      * @return <tt>true</tt> if this collection changed as a result of the
274      *         call
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      * Gestion de la géométrie surfacique des sorties.
285      * @return this.occasAreas Collection<OccasArea>
286      */
287     public Collection<OccasArea> getOccasAreas()
288     {
289         return this.occasAreas;
290     }
291 
292     /**
293      * Gestion de la géométrie surfacique des sorties.
294      * @param occasAreasIn Collection<OccasArea>
295      */
296     public void setOccasAreas(Collection<OccasArea> occasAreasIn)
297     {
298         this.occasAreas = occasAreasIn;
299     }
300 
301     /**
302      * Gestion de la géométrie surfacique des sorties.
303      * @param elementToAdd OccasArea
304      * @return <tt>true</tt> if this collection changed as a result of the
305      *         call
306      */
307     public boolean addOccasAreas(OccasArea elementToAdd)
308     {
309         return this.occasAreas.add(elementToAdd);
310     }
311 
312     /**
313      * Gestion de la géométrie surfacique des sorties.
314      * @param elementToRemove OccasArea
315      * @return <tt>true</tt> if this collection changed as a result of the
316      *         call
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      * Gestion de la géométrie ponctuelle des sorties.
327      * @return this.occasPoints Collection<OccasPoint>
328      */
329     public Collection<OccasPoint> getOccasPoints()
330     {
331         return this.occasPoints;
332     }
333 
334     /**
335      * Gestion de la géométrie ponctuelle des sorties.
336      * @param occasPointsIn Collection<OccasPoint>
337      */
338     public void setOccasPoints(Collection<OccasPoint> occasPointsIn)
339     {
340         this.occasPoints = occasPointsIn;
341     }
342 
343     /**
344      * Gestion de la géométrie ponctuelle des sorties.
345      * @param elementToAdd OccasPoint
346      * @return <tt>true</tt> if this collection changed as a result of the
347      *         call
348      */
349     public boolean addOccasPoints(OccasPoint elementToAdd)
350     {
351         return this.occasPoints.add(elementToAdd);
352     }
353 
354     /**
355      * Gestion de la géométrie ponctuelle des sorties.
356      * @param elementToRemove OccasPoint
357      * @return <tt>true</tt> if this collection changed as a result of the
358      *         call
359      */
360     public boolean removeOccasPoints(OccasPoint elementToRemove)
361     {
362         return this.occasPoints.remove(elementToRemove);
363     }
364 
365     private Department recorderDepartment;
366 
367     /**
368      * Liste les départements ou services auxquels sont rattachés les agents
369      * @return this.recorderDepartment Department
370      */
371     public Department getRecorderDepartment()
372     {
373         return this.recorderDepartment;
374     }
375 
376     /**
377      * Liste les départements ou services auxquels sont rattachés les agents
378      * @param recorderDepartmentIn Department
379      */
380     public void setRecorderDepartment(Department recorderDepartmentIn)
381     {
382         this.recorderDepartment = recorderDepartmentIn;
383     }
384 
385     private Campaign campaign;
386 
387     /**
388      * Liste des campagnes.
389      * @return this.campaign Campaign
390      */
391     public Campaign getCampaign()
392     {
393         return this.campaign;
394     }
395 
396     /**
397      * Liste des campagnes.
398      * @param campaignIn Campaign
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      * Gestion de la géométrie linéaire des sorties.
409      * @return this.occasLines Collection<OccasLine>
410      */
411     public Collection<OccasLine> getOccasLines()
412     {
413         return this.occasLines;
414     }
415 
416     /**
417      * Gestion de la géométrie linéaire des sorties.
418      * @param occasLinesIn Collection<OccasLine>
419      */
420     public void setOccasLines(Collection<OccasLine> occasLinesIn)
421     {
422         this.occasLines = occasLinesIn;
423     }
424 
425     /**
426      * Gestion de la géométrie linéaire des sorties.
427      * @param elementToAdd OccasLine
428      * @return <tt>true</tt> if this collection changed as a result of the
429      *         call
430      */
431     public boolean addOccasLines(OccasLine elementToAdd)
432     {
433         return this.occasLines.add(elementToAdd);
434     }
435 
436     /**
437      * Gestion de la géométrie linéaire des sorties.
438      * @param elementToRemove OccasLine
439      * @return <tt>true</tt> if this collection changed as a result of the
440      *         call
441      */
442     public boolean removeOccasLines(OccasLine elementToRemove)
443     {
444         return this.occasLines.remove(elementToRemove);
445     }
446 
447     private PositionningSystem positionningSystem;
448 
449     /**
450      * Informations complémentaires sur le positionnement d'un objet.
451      * @return this.positionningSystem PositionningSystem
452      */
453     public PositionningSystem getPositionningSystem()
454     {
455         return this.positionningSystem;
456     }
457 
458     /**
459      * Informations complémentaires sur le positionnement d'un objet.
460      * @param positionningSystemIn PositionningSystem
461      */
462     public void setPositionningSystem(PositionningSystem positionningSystemIn)
463     {
464         this.positionningSystem = positionningSystemIn;
465     }
466 
467     private Ship ship;
468 
469     /**
470      * Liste des navires intervenant dans les campagnes ou sorties Quadrige2.
471      * @return this.ship Ship
472      */
473     public Ship getShip()
474     {
475         return this.ship;
476     }
477 
478     /**
479      * Liste des navires intervenant dans les campagnes ou sorties Quadrige2.
480      * @param shipIn Ship
481      */
482     public void setShip(Ship shipIn)
483     {
484         this.ship = shipIn;
485     }
486 
487     /**
488      * Returns <code>true</code> if the argument is an Occasion instance and all identifiers for this entity
489      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
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      * Returns a hash code based on this entity's identifiers.
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      * Constructs new instances of {@link Occasion}.
524      */
525     public static final class Factory
526     {
527         /**
528          * Constructs a new instance of {@link Occasion}.
529          * @return new OccasionImpl()
530          */
531         public static Occasion newInstance()
532         {
533             return new OccasionImpl();
534         }
535 
536         /**
537          * Constructs a new instance of {@link Occasion}, taking all required and/or
538          * read-only properties as arguments, except for identifiers.
539          * @param occasDt Date
540          * @param occasNm String
541          * @param recorderDepartment Department
542          * @param campaign Campaign
543          * @return newInstance
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          * Constructs a new instance of {@link Occasion}, taking all possible properties
557          * (except the identifier(s))as arguments.
558          * @param occasDt Date
559          * @param occasNm String
560          * @param occasCm String
561          * @param occasPositionCm String
562          * @param updateDt Timestamp
563          * @param remoteId Integer
564          * @param moratoria Collection<Moratorium>
565          * @param qusers Collection<Quser>
566          * @param occasAreas Collection<OccasArea>
567          * @param occasPoints Collection<OccasPoint>
568          * @param recorderDepartment Department
569          * @param campaign Campaign
570          * @param occasLines Collection<OccasLine>
571          * @param positionningSystem PositionningSystem
572          * @param ship Ship
573          * @return newInstance Occasion
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      * @see Comparable#compareTo
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 // HibernateEntity.vsl merge-point
637 // Occasion.java merge-point
638 }