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.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   * Liste des campagnes.
44   */
45  // HibernateEntity.vsl annotations merge-point
46  public abstract class Campaign
47      implements Serializable, Comparable<Campaign>
48  {
49      /**
50       * The serial version UID of this class. Needed for serialization.
51       */
52      private static final long serialVersionUID = -7823753622861992792L;
53  
54      // Generate 9 attributes
55      private Integer campaignId;
56  
57      /**
58       * Identifiant interne de la campagne. Renseigné par le système dans tous les cas.
59       * @return this.campaignId Integer
60       */
61      public Integer getCampaignId()
62      {
63          return this.campaignId;
64      }
65  
66      /**
67       * Identifiant interne de la campagne. Renseigné par le système dans tous les cas.
68       * @param campaignIdIn Integer
69       */
70      public void setCampaignId(Integer campaignIdIn)
71      {
72          this.campaignId = campaignIdIn;
73      }
74  
75      private String campaignSismerLk;
76  
77      /**
78       * Lien vers le serveur SISMER. Probablement la référence SISMER de la campagne CAM_CAMREF
79       * (FI351997020020 par exemple)
80       * @return this.campaignSismerLk String
81       */
82      public String getCampaignSismerLk()
83      {
84          return this.campaignSismerLk;
85      }
86  
87      /**
88       * Lien vers le serveur SISMER. Probablement la référence SISMER de la campagne CAM_CAMREF
89       * (FI351997020020 par exemple)
90       * @param campaignSismerLkIn String
91       */
92      public void setCampaignSismerLk(String campaignSismerLkIn)
93      {
94          this.campaignSismerLk = campaignSismerLkIn;
95      }
96  
97      private Date campaignStartDt;
98  
99      /**
100      * Date de début de la campagne. ne pas renseigner si SISMER
101      * @return this.campaignStartDt Date
102      */
103     public Date getCampaignStartDt()
104     {
105         return this.campaignStartDt;
106     }
107 
108     /**
109      * Date de début de la campagne. ne pas renseigner si SISMER
110      * @param campaignStartDtIn Date
111      */
112     public void setCampaignStartDt(Date campaignStartDtIn)
113     {
114         this.campaignStartDt = campaignStartDtIn;
115     }
116 
117     private Date campaignEndDt;
118 
119     /**
120      * Date de fin de la campagne. Ne pas renseigner si SISMER.
121      * @return this.campaignEndDt Date
122      */
123     public Date getCampaignEndDt()
124     {
125         return this.campaignEndDt;
126     }
127 
128     /**
129      * Date de fin de la campagne. Ne pas renseigner si SISMER.
130      * @param campaignEndDtIn Date
131      */
132     public void setCampaignEndDt(Date campaignEndDtIn)
133     {
134         this.campaignEndDt = campaignEndDtIn;
135     }
136 
137     private String campaignNm;
138 
139     /**
140      * Llibellé décrivant la campagne. Ne pas renseigner si SISMER.
141      * @return this.campaignNm String
142      */
143     public String getCampaignNm()
144     {
145         return this.campaignNm;
146     }
147 
148     /**
149      * Llibellé décrivant la campagne. Ne pas renseigner si SISMER.
150      * @param campaignNmIn String
151      */
152     public void setCampaignNm(String campaignNmIn)
153     {
154         this.campaignNm = campaignNmIn;
155     }
156 
157     private String campaignCm;
158 
159     /**
160      * Commentaire sur la campagne. Ne pas renseigner si SISMER.
161      * @return this.campaignCm String
162      */
163     public String getCampaignCm()
164     {
165         return this.campaignCm;
166     }
167 
168     /**
169      * Commentaire sur la campagne. Ne pas renseigner si SISMER.
170      * @param campaignCmIn String
171      */
172     public void setCampaignCm(String campaignCmIn)
173     {
174         this.campaignCm = campaignCmIn;
175     }
176 
177     private String campaignPositionCm;
178 
179     /**
180      * Commentaire associé à la localisation
181      * @return this.campaignPositionCm String
182      */
183     public String getCampaignPositionCm()
184     {
185         return this.campaignPositionCm;
186     }
187 
188     /**
189      * Commentaire associé à la localisation
190      * @param campaignPositionCmIn String
191      */
192     public void setCampaignPositionCm(String campaignPositionCmIn)
193     {
194         this.campaignPositionCm = campaignPositionCmIn;
195     }
196 
197     private Timestamp updateDt;
198 
199     /**
200      * Date de modification de l'objet, mise à jour par le système
201      * @return this.updateDt Timestamp
202      */
203     public Timestamp getUpdateDt()
204     {
205         return this.updateDt;
206     }
207 
208     /**
209      * Date de modification de l'objet, mise à jour par le système
210      * @param updateDtIn Timestamp
211      */
212     public void setUpdateDt(Timestamp updateDtIn)
213     {
214         this.updateDt = updateDtIn;
215     }
216 
217     private Integer remoteId;
218 
219     /**
220      * 
221      * @return this.remoteId Integer
222      */
223     public Integer getRemoteId()
224     {
225         return this.remoteId;
226     }
227 
228     /**
229      * 
230      * @param remoteIdIn Integer
231      */
232     public void setRemoteId(Integer remoteIdIn)
233     {
234         this.remoteId = remoteIdIn;
235     }
236 
237     // Generate 11 associations
238     private Collection<Moratorium> moratoria = new HashSet<Moratorium>();
239 
240     /**
241      * Moratoire sur la restriction d'accès aux données
242      * @return this.moratoria Collection<Moratorium>
243      */
244     public Collection<Moratorium> getMoratoria()
245     {
246         return this.moratoria;
247     }
248 
249     /**
250      * Moratoire sur la restriction d'accès aux données
251      * @param moratoriaIn Collection<Moratorium>
252      */
253     public void setMoratoria(Collection<Moratorium> moratoriaIn)
254     {
255         this.moratoria = moratoriaIn;
256     }
257 
258     /**
259      * Moratoire sur la restriction d'accès aux données
260      * @param elementToAdd Moratorium
261      * @return <tt>true</tt> if this collection changed as a result of the
262      *         call
263      */
264     public boolean addMoratoria(Moratorium elementToAdd)
265     {
266         return this.moratoria.add(elementToAdd);
267     }
268 
269     /**
270      * Moratoire sur la restriction d'accès aux données
271      * @param elementToRemove Moratorium
272      * @return <tt>true</tt> if this collection changed as a result of the
273      *         call
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      * Gestion de la géométrie ponctuelle des campagnes.
284      * @return this.campaignPoints Collection<CampaignPoint>
285      */
286     public Collection<CampaignPoint> getCampaignPoints()
287     {
288         return this.campaignPoints;
289     }
290 
291     /**
292      * Gestion de la géométrie ponctuelle des campagnes.
293      * @param campaignPointsIn Collection<CampaignPoint>
294      */
295     public void setCampaignPoints(Collection<CampaignPoint> campaignPointsIn)
296     {
297         this.campaignPoints = campaignPointsIn;
298     }
299 
300     /**
301      * Gestion de la géométrie ponctuelle des campagnes.
302      * @param elementToAdd CampaignPoint
303      * @return <tt>true</tt> if this collection changed as a result of the
304      *         call
305      */
306     public boolean addCampaignPoints(CampaignPoint elementToAdd)
307     {
308         return this.campaignPoints.add(elementToAdd);
309     }
310 
311     /**
312      * Gestion de la géométrie ponctuelle des campagnes.
313      * @param elementToRemove CampaignPoint
314      * @return <tt>true</tt> if this collection changed as a result of the
315      *         call
316      */
317     public boolean removeCampaignPoints(CampaignPoint elementToRemove)
318     {
319         return this.campaignPoints.remove(elementToRemove);
320     }
321 
322     private Quser quser;
323 
324     /**
325      * Liste l'ensemble des agents et utilisateurs du système.
326      * @return this.quser Quser
327      */
328     public Quser getQuser()
329     {
330         return this.quser;
331     }
332 
333     /**
334      * Liste l'ensemble des agents et utilisateurs du système.
335      * @param quserIn Quser
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      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
346      * @return this.programs Collection<Program>
347      */
348     public Collection<Program> getPrograms()
349     {
350         return this.programs;
351     }
352 
353     /**
354      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
355      * @param programsIn Collection<Program>
356      */
357     public void setPrograms(Collection<Program> programsIn)
358     {
359         this.programs = programsIn;
360     }
361 
362     /**
363      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
364      * @param elementToAdd Program
365      * @return <tt>true</tt> if this collection changed as a result of the
366      *         call
367      */
368     public boolean addPrograms(Program elementToAdd)
369     {
370         return this.programs.add(elementToAdd);
371     }
372 
373     /**
374      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
375      * @param elementToRemove Program
376      * @return <tt>true</tt> if this collection changed as a result of the
377      *         call
378      */
379     public boolean removePrograms(Program elementToRemove)
380     {
381         return this.programs.remove(elementToRemove);
382     }
383 
384     private Ship ship;
385 
386     /**
387      * Liste des navires intervenant dans les campagnes ou sorties Quadrige2.
388      * @return this.ship Ship
389      */
390     public Ship getShip()
391     {
392         return this.ship;
393     }
394 
395     /**
396      * Liste des navires intervenant dans les campagnes ou sorties Quadrige2.
397      * @param shipIn Ship
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      * Liste des sorties effectuées lors d'une campagne.
408      * @return this.occasions Collection<Occasion>
409      */
410     public Collection<Occasion> getOccasions()
411     {
412         return this.occasions;
413     }
414 
415     /**
416      * Liste des sorties effectuées lors d'une campagne.
417      * @param occasionsIn Collection<Occasion>
418      */
419     public void setOccasions(Collection<Occasion> occasionsIn)
420     {
421         this.occasions = occasionsIn;
422     }
423 
424     /**
425      * Liste des sorties effectuées lors d'une campagne.
426      * @param elementToAdd Occasion
427      * @return <tt>true</tt> if this collection changed as a result of the
428      *         call
429      */
430     public boolean addOccasions(Occasion elementToAdd)
431     {
432         return this.occasions.add(elementToAdd);
433     }
434 
435     /**
436      * Liste des sorties effectuées lors d'une campagne.
437      * @param elementToRemove Occasion
438      * @return <tt>true</tt> if this collection changed as a result of the
439      *         call
440      */
441     public boolean removeOccasions(Occasion elementToRemove)
442     {
443         return this.occasions.remove(elementToRemove);
444     }
445 
446     private PositionningSystem positionningSystem;
447 
448     /**
449      * Informations complémentaires sur le positionnement d'un objet.
450      * @return this.positionningSystem PositionningSystem
451      */
452     public PositionningSystem getPositionningSystem()
453     {
454         return this.positionningSystem;
455     }
456 
457     /**
458      * Informations complémentaires sur le positionnement d'un objet.
459      * @param positionningSystemIn PositionningSystem
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      * Gestion de la géométrie linéaire des campagnes.
470      * @return this.campaignLines Collection<CampaignLine>
471      */
472     public Collection<CampaignLine> getCampaignLines()
473     {
474         return this.campaignLines;
475     }
476 
477     /**
478      * Gestion de la géométrie linéaire des campagnes.
479      * @param campaignLinesIn Collection<CampaignLine>
480      */
481     public void setCampaignLines(Collection<CampaignLine> campaignLinesIn)
482     {
483         this.campaignLines = campaignLinesIn;
484     }
485 
486     /**
487      * Gestion de la géométrie linéaire des campagnes.
488      * @param elementToAdd CampaignLine
489      * @return <tt>true</tt> if this collection changed as a result of the
490      *         call
491      */
492     public boolean addCampaignLines(CampaignLine elementToAdd)
493     {
494         return this.campaignLines.add(elementToAdd);
495     }
496 
497     /**
498      * Gestion de la géométrie linéaire des campagnes.
499      * @param elementToRemove CampaignLine
500      * @return <tt>true</tt> if this collection changed as a result of the
501      *         call
502      */
503     public boolean removeCampaignLines(CampaignLine elementToRemove)
504     {
505         return this.campaignLines.remove(elementToRemove);
506     }
507 
508     private Department recorderDepartment;
509 
510     /**
511      * Liste les départements ou services auxquels sont rattachés les agents
512      * @return this.recorderDepartment Department
513      */
514     public Department getRecorderDepartment()
515     {
516         return this.recorderDepartment;
517     }
518 
519     /**
520      * Liste les départements ou services auxquels sont rattachés les agents
521      * @param recorderDepartmentIn Department
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      * Gestion de la géométrie surfacique des campagnes.
532      * @return this.campaignAreas Collection<CampaignArea>
533      */
534     public Collection<CampaignArea> getCampaignAreas()
535     {
536         return this.campaignAreas;
537     }
538 
539     /**
540      * Gestion de la géométrie surfacique des campagnes.
541      * @param campaignAreasIn Collection<CampaignArea>
542      */
543     public void setCampaignAreas(Collection<CampaignArea> campaignAreasIn)
544     {
545         this.campaignAreas = campaignAreasIn;
546     }
547 
548     /**
549      * Gestion de la géométrie surfacique des campagnes.
550      * @param elementToAdd CampaignArea
551      * @return <tt>true</tt> if this collection changed as a result of the
552      *         call
553      */
554     public boolean addCampaignAreas(CampaignArea elementToAdd)
555     {
556         return this.campaignAreas.add(elementToAdd);
557     }
558 
559     /**
560      * Gestion de la géométrie surfacique des campagnes.
561      * @param elementToRemove CampaignArea
562      * @return <tt>true</tt> if this collection changed as a result of the
563      *         call
564      */
565     public boolean removeCampaignAreas(CampaignArea elementToRemove)
566     {
567         return this.campaignAreas.remove(elementToRemove);
568     }
569 
570     /**
571      * Returns <code>true</code> if the argument is an Campaign instance and all identifiers for this entity
572      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
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      * Returns a hash code based on this entity's identifiers.
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      * Constructs new instances of {@link Campaign}.
607      */
608     public static final class Factory
609     {
610         /**
611          * Constructs a new instance of {@link Campaign}.
612          * @return new CampaignImpl()
613          */
614         public static Campaign newInstance()
615         {
616             return new CampaignImpl();
617         }
618 
619         /**
620          * Constructs a new instance of {@link Campaign}, taking all required and/or
621          * read-only properties as arguments, except for identifiers.
622          * @param campaignStartDt Date
623          * @param campaignNm String
624          * @param quser Quser
625          * @param recorderDepartment Department
626          * @return newInstance
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          * Constructs a new instance of {@link Campaign}, taking all possible properties
640          * (except the identifier(s))as arguments.
641          * @param campaignSismerLk String
642          * @param campaignStartDt Date
643          * @param campaignEndDt Date
644          * @param campaignNm String
645          * @param campaignCm String
646          * @param campaignPositionCm String
647          * @param updateDt Timestamp
648          * @param remoteId Integer
649          * @param moratoria Collection<Moratorium>
650          * @param campaignPoints Collection<CampaignPoint>
651          * @param quser Quser
652          * @param programs Collection<Program>
653          * @param ship Ship
654          * @param occasions Collection<Occasion>
655          * @param positionningSystem PositionningSystem
656          * @param campaignLines Collection<CampaignLine>
657          * @param recorderDepartment Department
658          * @param campaignAreas Collection<CampaignArea>
659          * @return newInstance Campaign
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      * @see Comparable#compareTo
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 // HibernateEntity.vsl merge-point
734 // Campaign.java merge-point
735 }