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.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.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   * Liste des campagnes.
45   */
46  // HibernateEntity.vsl annotations merge-point
47  public abstract class Campaign
48      implements Serializable, Comparable<Campaign>
49  {
50      /**
51       * The serial version UID of this class. Needed for serialization.
52       */
53      private static final long serialVersionUID = -899026039084714161L;
54  
55      // Generate 8 attributes
56      private Integer campaignId;
57  
58      /**
59       * Identifiant interne de la campagne. Renseigné par le système dans tous les cas.
60       * @return this.campaignId Integer
61       */
62      public Integer getCampaignId()
63      {
64          return this.campaignId;
65      }
66  
67      /**
68       * Identifiant interne de la campagne. Renseigné par le système dans tous les cas.
69       * @param campaignIdIn Integer
70       */
71      public void setCampaignId(Integer campaignIdIn)
72      {
73          this.campaignId = campaignIdIn;
74      }
75  
76      private String campaignSismerLk;
77  
78      /**
79       * Lien vers le serveur SISMER. Probablement la référence SISMER de la campagne CAM_CAMREF
80       * (FI351997020020 par exemple)
81       * @return this.campaignSismerLk String
82       */
83      public String getCampaignSismerLk()
84      {
85          return this.campaignSismerLk;
86      }
87  
88      /**
89       * Lien vers le serveur SISMER. Probablement la référence SISMER de la campagne CAM_CAMREF
90       * (FI351997020020 par exemple)
91       * @param campaignSismerLkIn String
92       */
93      public void setCampaignSismerLk(String campaignSismerLkIn)
94      {
95          this.campaignSismerLk = campaignSismerLkIn;
96      }
97  
98      private Date campaignStartDt;
99  
100     /**
101      * Date de début de la campagne. ne pas renseigner si SISMER
102      * @return this.campaignStartDt Date
103      */
104     public Date getCampaignStartDt()
105     {
106         return this.campaignStartDt;
107     }
108 
109     /**
110      * Date de début de la campagne. ne pas renseigner si SISMER
111      * @param campaignStartDtIn Date
112      */
113     public void setCampaignStartDt(Date campaignStartDtIn)
114     {
115         this.campaignStartDt = campaignStartDtIn;
116     }
117 
118     private Date campaignEndDt;
119 
120     /**
121      * Date de fin de la campagne. Ne pas renseigner si SISMER.
122      * @return this.campaignEndDt Date
123      */
124     public Date getCampaignEndDt()
125     {
126         return this.campaignEndDt;
127     }
128 
129     /**
130      * Date de fin de la campagne. Ne pas renseigner si SISMER.
131      * @param campaignEndDtIn Date
132      */
133     public void setCampaignEndDt(Date campaignEndDtIn)
134     {
135         this.campaignEndDt = campaignEndDtIn;
136     }
137 
138     private String campaignNm;
139 
140     /**
141      * Llibellé décrivant la campagne. Ne pas renseigner si SISMER.
142      * @return this.campaignNm String
143      */
144     public String getCampaignNm()
145     {
146         return this.campaignNm;
147     }
148 
149     /**
150      * Llibellé décrivant la campagne. Ne pas renseigner si SISMER.
151      * @param campaignNmIn String
152      */
153     public void setCampaignNm(String campaignNmIn)
154     {
155         this.campaignNm = campaignNmIn;
156     }
157 
158     private String campaignCm;
159 
160     /**
161      * Commentaire sur la campagne. Ne pas renseigner si SISMER.
162      * @return this.campaignCm String
163      */
164     public String getCampaignCm()
165     {
166         return this.campaignCm;
167     }
168 
169     /**
170      * Commentaire sur la campagne. Ne pas renseigner si SISMER.
171      * @param campaignCmIn String
172      */
173     public void setCampaignCm(String campaignCmIn)
174     {
175         this.campaignCm = campaignCmIn;
176     }
177 
178     private String campaignPositionCm;
179 
180     /**
181      * Commentaire associé à la localisation
182      * @return this.campaignPositionCm String
183      */
184     public String getCampaignPositionCm()
185     {
186         return this.campaignPositionCm;
187     }
188 
189     /**
190      * Commentaire associé à la localisation
191      * @param campaignPositionCmIn String
192      */
193     public void setCampaignPositionCm(String campaignPositionCmIn)
194     {
195         this.campaignPositionCm = campaignPositionCmIn;
196     }
197 
198     private Timestamp updateDt;
199 
200     /**
201      * Date de modification de l'objet, mise à jour par le système
202      * @return this.updateDt Timestamp
203      */
204     public Timestamp getUpdateDt()
205     {
206         return this.updateDt;
207     }
208 
209     /**
210      * Date de modification de l'objet, mise à jour par le système
211      * @param updateDtIn Timestamp
212      */
213     public void setUpdateDt(Timestamp updateDtIn)
214     {
215         this.updateDt = updateDtIn;
216     }
217 
218     // Generate 11 associations
219     private Collection<Moratorium> moratoria = new HashSet<Moratorium>();
220 
221     /**
222      * Moratoire sur la restriction d'accès aux données
223      * @return this.moratoria Collection<Moratorium>
224      */
225     public Collection<Moratorium> getMoratoria()
226     {
227         return this.moratoria;
228     }
229 
230     /**
231      * Moratoire sur la restriction d'accès aux données
232      * @param moratoriaIn Collection<Moratorium>
233      */
234     public void setMoratoria(Collection<Moratorium> moratoriaIn)
235     {
236         this.moratoria = moratoriaIn;
237     }
238 
239     /**
240      * Moratoire sur la restriction d'accès aux données
241      * @param elementToAdd Moratorium
242      * @return <tt>true</tt> if this collection changed as a result of the
243      *         call
244      */
245     public boolean addMoratoria(Moratorium elementToAdd)
246     {
247         return this.moratoria.add(elementToAdd);
248     }
249 
250     /**
251      * Moratoire sur la restriction d'accès aux données
252      * @param elementToRemove Moratorium
253      * @return <tt>true</tt> if this collection changed as a result of the
254      *         call
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      * Gestion de la géométrie ponctuelle des campagnes.
265      * @return this.campaignPoints Collection<CampaignPoint>
266      */
267     public Collection<CampaignPoint> getCampaignPoints()
268     {
269         return this.campaignPoints;
270     }
271 
272     /**
273      * Gestion de la géométrie ponctuelle des campagnes.
274      * @param campaignPointsIn Collection<CampaignPoint>
275      */
276     public void setCampaignPoints(Collection<CampaignPoint> campaignPointsIn)
277     {
278         this.campaignPoints = campaignPointsIn;
279     }
280 
281     /**
282      * Gestion de la géométrie ponctuelle des campagnes.
283      * @param elementToAdd CampaignPoint
284      * @return <tt>true</tt> if this collection changed as a result of the
285      *         call
286      */
287     public boolean addCampaignPoints(CampaignPoint elementToAdd)
288     {
289         return this.campaignPoints.add(elementToAdd);
290     }
291 
292     /**
293      * Gestion de la géométrie ponctuelle des campagnes.
294      * @param elementToRemove CampaignPoint
295      * @return <tt>true</tt> if this collection changed as a result of the
296      *         call
297      */
298     public boolean removeCampaignPoints(CampaignPoint elementToRemove)
299     {
300         return this.campaignPoints.remove(elementToRemove);
301     }
302 
303     private Quser quser;
304 
305     /**
306      * Liste l'ensemble des agents et utilisateurs du système.
307      * @return this.quser Quser
308      */
309     public Quser getQuser()
310     {
311         return this.quser;
312     }
313 
314     /**
315      * Liste l'ensemble des agents et utilisateurs du système.
316      * @param quserIn Quser
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      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
327      * @return this.programs Collection<Program>
328      */
329     public Collection<Program> getPrograms()
330     {
331         return this.programs;
332     }
333 
334     /**
335      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
336      * @param programsIn Collection<Program>
337      */
338     public void setPrograms(Collection<Program> programsIn)
339     {
340         this.programs = programsIn;
341     }
342 
343     /**
344      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
345      * @param elementToAdd Program
346      * @return <tt>true</tt> if this collection changed as a result of the
347      *         call
348      */
349     public boolean addPrograms(Program elementToAdd)
350     {
351         return this.programs.add(elementToAdd);
352     }
353 
354     /**
355      * Activités à l'origine de la collecte d'un ensemble cohérent de données.
356      * @param elementToRemove Program
357      * @return <tt>true</tt> if this collection changed as a result of the
358      *         call
359      */
360     public boolean removePrograms(Program elementToRemove)
361     {
362         return this.programs.remove(elementToRemove);
363     }
364 
365     private Ship ship;
366 
367     /**
368      * Liste des navires intervenant dans les campagnes ou sorties Quadrige2.
369      * @return this.ship Ship
370      */
371     public Ship getShip()
372     {
373         return this.ship;
374     }
375 
376     /**
377      * Liste des navires intervenant dans les campagnes ou sorties Quadrige2.
378      * @param shipIn Ship
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      * Liste des sorties effectuées lors d'une campagne.
389      * @return this.occasions Collection<Occasion>
390      */
391     public Collection<Occasion> getOccasions()
392     {
393         return this.occasions;
394     }
395 
396     /**
397      * Liste des sorties effectuées lors d'une campagne.
398      * @param occasionsIn Collection<Occasion>
399      */
400     public void setOccasions(Collection<Occasion> occasionsIn)
401     {
402         this.occasions = occasionsIn;
403     }
404 
405     /**
406      * Liste des sorties effectuées lors d'une campagne.
407      * @param elementToAdd Occasion
408      * @return <tt>true</tt> if this collection changed as a result of the
409      *         call
410      */
411     public boolean addOccasions(Occasion elementToAdd)
412     {
413         return this.occasions.add(elementToAdd);
414     }
415 
416     /**
417      * Liste des sorties effectuées lors d'une campagne.
418      * @param elementToRemove Occasion
419      * @return <tt>true</tt> if this collection changed as a result of the
420      *         call
421      */
422     public boolean removeOccasions(Occasion elementToRemove)
423     {
424         return this.occasions.remove(elementToRemove);
425     }
426 
427     private PositionningSystem positionningSystem;
428 
429     /**
430      * Informations complémentaires sur le positionnement d'un objet.
431      * @return this.positionningSystem PositionningSystem
432      */
433     public PositionningSystem getPositionningSystem()
434     {
435         return this.positionningSystem;
436     }
437 
438     /**
439      * Informations complémentaires sur le positionnement d'un objet.
440      * @param positionningSystemIn PositionningSystem
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      * Gestion de la géométrie linéaire des campagnes.
451      * @return this.campaignLines Collection<CampaignLine>
452      */
453     public Collection<CampaignLine> getCampaignLines()
454     {
455         return this.campaignLines;
456     }
457 
458     /**
459      * Gestion de la géométrie linéaire des campagnes.
460      * @param campaignLinesIn Collection<CampaignLine>
461      */
462     public void setCampaignLines(Collection<CampaignLine> campaignLinesIn)
463     {
464         this.campaignLines = campaignLinesIn;
465     }
466 
467     /**
468      * Gestion de la géométrie linéaire des campagnes.
469      * @param elementToAdd CampaignLine
470      * @return <tt>true</tt> if this collection changed as a result of the
471      *         call
472      */
473     public boolean addCampaignLines(CampaignLine elementToAdd)
474     {
475         return this.campaignLines.add(elementToAdd);
476     }
477 
478     /**
479      * Gestion de la géométrie linéaire des campagnes.
480      * @param elementToRemove CampaignLine
481      * @return <tt>true</tt> if this collection changed as a result of the
482      *         call
483      */
484     public boolean removeCampaignLines(CampaignLine elementToRemove)
485     {
486         return this.campaignLines.remove(elementToRemove);
487     }
488 
489     private Department recorderDepartment;
490 
491     /**
492      * Liste les départements ou services auxquels sont rattachés les agents
493      * @return this.recorderDepartment Department
494      */
495     public Department getRecorderDepartment()
496     {
497         return this.recorderDepartment;
498     }
499 
500     /**
501      * Liste les départements ou services auxquels sont rattachés les agents
502      * @param recorderDepartmentIn Department
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      * Gestion de la géométrie surfacique des campagnes.
513      * @return this.campaignAreas Collection<CampaignArea>
514      */
515     public Collection<CampaignArea> getCampaignAreas()
516     {
517         return this.campaignAreas;
518     }
519 
520     /**
521      * Gestion de la géométrie surfacique des campagnes.
522      * @param campaignAreasIn Collection<CampaignArea>
523      */
524     public void setCampaignAreas(Collection<CampaignArea> campaignAreasIn)
525     {
526         this.campaignAreas = campaignAreasIn;
527     }
528 
529     /**
530      * Gestion de la géométrie surfacique des campagnes.
531      * @param elementToAdd CampaignArea
532      * @return <tt>true</tt> if this collection changed as a result of the
533      *         call
534      */
535     public boolean addCampaignAreas(CampaignArea elementToAdd)
536     {
537         return this.campaignAreas.add(elementToAdd);
538     }
539 
540     /**
541      * Gestion de la géométrie surfacique des campagnes.
542      * @param elementToRemove CampaignArea
543      * @return <tt>true</tt> if this collection changed as a result of the
544      *         call
545      */
546     public boolean removeCampaignAreas(CampaignArea elementToRemove)
547     {
548         return this.campaignAreas.remove(elementToRemove);
549     }
550 
551     /**
552      * Returns <code>true</code> if the argument is an Campaign instance and all identifiers for this entity
553      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
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      * Returns a hash code based on this entity's identifiers.
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      * Constructs new instances of {@link Campaign}.
588      */
589     public static final class Factory
590     {
591         /**
592          * Constructs a new instance of {@link Campaign}.
593          * @return new CampaignImpl()
594          */
595         public static Campaign newInstance()
596         {
597             return new CampaignImpl();
598         }
599 
600         /**
601          * Constructs a new instance of {@link Campaign}, taking all required and/or
602          * read-only properties as arguments, except for identifiers.
603          * @param campaignStartDt Date
604          * @param campaignNm String
605          * @param updateDt Timestamp
606          * @param quser Quser
607          * @param recorderDepartment Department
608          * @return newInstance
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          * Constructs a new instance of {@link Campaign}, taking all possible properties
623          * (except the identifier(s))as arguments.
624          * @param campaignSismerLk String
625          * @param campaignStartDt Date
626          * @param campaignEndDt Date
627          * @param campaignNm String
628          * @param campaignCm String
629          * @param campaignPositionCm String
630          * @param updateDt Timestamp
631          * @param moratoria Collection<Moratorium>
632          * @param campaignPoints Collection<CampaignPoint>
633          * @param quser Quser
634          * @param programs Collection<Program>
635          * @param ship Ship
636          * @param occasions Collection<Occasion>
637          * @param positionningSystem PositionningSystem
638          * @param campaignLines Collection<CampaignLine>
639          * @param recorderDepartment Department
640          * @param campaignAreas Collection<CampaignArea>
641          * @return newInstance Campaign
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      * @see Comparable#compareTo
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 // HibernateEntity.vsl merge-point
711 // Campaign.java merge-point
712 }