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.referential.pmfm;
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.PmfmMor;
30  import fr.ifremer.quadrige2.core.dao.referential.Status;
31  import fr.ifremer.quadrige2.core.dao.sandre.SandreFractionExp;
32  import fr.ifremer.quadrige2.core.dao.sandre.SandreFractionImp;
33  import java.io.Serializable;
34  import java.sql.Timestamp;
35  import java.util.Collection;
36  import java.util.Date;
37  import java.util.HashSet;
38  
39  /**
40   * Liste les fractions (compléter la description).
41   */
42  // HibernateEntity.vsl annotations merge-point
43  public abstract class Fraction
44      implements Serializable, Comparable<Fraction>
45  {
46      /**
47       * The serial version UID of this class. Needed for serialization.
48       */
49      private static final long serialVersionUID = -7816806677988726532L;
50  
51      // Generate 5 attributes
52      private Integer fractionId;
53  
54      /**
55       * Identifiant interne de la fraction
56       * @return this.fractionId Integer
57       */
58      public Integer getFractionId()
59      {
60          return this.fractionId;
61      }
62  
63      /**
64       * Identifiant interne de la fraction
65       * @param fractionIdIn Integer
66       */
67      public void setFractionId(Integer fractionIdIn)
68      {
69          this.fractionId = fractionIdIn;
70      }
71  
72      private String fractionNm;
73  
74      /**
75       * Libellé de la fraction
76       * @return this.fractionNm String
77       */
78      public String getFractionNm()
79      {
80          return this.fractionNm;
81      }
82  
83      /**
84       * Libellé de la fraction
85       * @param fractionNmIn String
86       */
87      public void setFractionNm(String fractionNmIn)
88      {
89          this.fractionNm = fractionNmIn;
90      }
91  
92      private String fractionDc;
93  
94      /**
95       * Description de la fraction
96       * @return this.fractionDc String
97       */
98      public String getFractionDc()
99      {
100         return this.fractionDc;
101     }
102 
103     /**
104      * Description de la fraction
105      * @param fractionDcIn String
106      */
107     public void setFractionDc(String fractionDcIn)
108     {
109         this.fractionDc = fractionDcIn;
110     }
111 
112     private Date fractionCreationDt;
113 
114     /**
115      * Date de création de la fraction
116      * @return this.fractionCreationDt Date
117      */
118     public Date getFractionCreationDt()
119     {
120         return this.fractionCreationDt;
121     }
122 
123     /**
124      * Date de création de la fraction
125      * @param fractionCreationDtIn Date
126      */
127     public void setFractionCreationDt(Date fractionCreationDtIn)
128     {
129         this.fractionCreationDt = fractionCreationDtIn;
130     }
131 
132     private Timestamp updateDt;
133 
134     /**
135      * Date de mise à jour de la fraction
136      * @return this.updateDt Timestamp
137      */
138     public Timestamp getUpdateDt()
139     {
140         return this.updateDt;
141     }
142 
143     /**
144      * Date de mise à jour de la fraction
145      * @param updateDtIn Timestamp
146      */
147     public void setUpdateDt(Timestamp updateDtIn)
148     {
149         this.updateDt = updateDtIn;
150     }
151 
152     // Generate 8 associations
153     private Collection<SandreFractionExp> sandreFractionExpIds = new HashSet<SandreFractionExp>();
154 
155     /**
156      * Fraction SANDRE pour les exports de données
157      * @return this.sandreFractionExpIds Collection<SandreFractionExp>
158      */
159     public Collection<SandreFractionExp> getSandreFractionExpIds()
160     {
161         return this.sandreFractionExpIds;
162     }
163 
164     /**
165      * Fraction SANDRE pour les exports de données
166      * @param sandreFractionExpIdsIn Collection<SandreFractionExp>
167      */
168     public void setSandreFractionExpIds(Collection<SandreFractionExp> sandreFractionExpIdsIn)
169     {
170         this.sandreFractionExpIds = sandreFractionExpIdsIn;
171     }
172 
173     /**
174      * Fraction SANDRE pour les exports de données
175      * @param elementToAdd SandreFractionExp
176      * @return <tt>true</tt> if this collection changed as a result of the
177      *         call
178      */
179     public boolean addSandreFractionExpIds(SandreFractionExp elementToAdd)
180     {
181         return this.sandreFractionExpIds.add(elementToAdd);
182     }
183 
184     /**
185      * Fraction SANDRE pour les exports de données
186      * @param elementToRemove SandreFractionExp
187      * @return <tt>true</tt> if this collection changed as a result of the
188      *         call
189      */
190     public boolean removeSandreFractionExpIds(SandreFractionExp elementToRemove)
191     {
192         return this.sandreFractionExpIds.remove(elementToRemove);
193     }
194 
195     private Collection<PmfmMor> pmfmMors = new HashSet<PmfmMor>();
196 
197     /**
198      * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
199      * @return this.pmfmMors Collection<PmfmMor>
200      */
201     public Collection<PmfmMor> getPmfmMors()
202     {
203         return this.pmfmMors;
204     }
205 
206     /**
207      * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
208      * @param pmfmMorsIn Collection<PmfmMor>
209      */
210     public void setPmfmMors(Collection<PmfmMor> pmfmMorsIn)
211     {
212         this.pmfmMors = pmfmMorsIn;
213     }
214 
215     /**
216      * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
217      * @param elementToAdd PmfmMor
218      * @return <tt>true</tt> if this collection changed as a result of the
219      *         call
220      */
221     public boolean addPmfmMors(PmfmMor elementToAdd)
222     {
223         return this.pmfmMors.add(elementToAdd);
224     }
225 
226     /**
227      * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
228      * @param elementToRemove PmfmMor
229      * @return <tt>true</tt> if this collection changed as a result of the
230      *         call
231      */
232     public boolean removePmfmMors(PmfmMor elementToRemove)
233     {
234         return this.pmfmMors.remove(elementToRemove);
235     }
236 
237     private Collection<Matrix> matrixes = new HashSet<Matrix>();
238 
239     /**
240      * Support utilisé pour mesurer un paramètre.
241      * @return this.matrixes Collection<Matrix>
242      */
243     public Collection<Matrix> getMatrixes()
244     {
245         return this.matrixes;
246     }
247 
248     /**
249      * Support utilisé pour mesurer un paramètre.
250      * @param matrixesIn Collection<Matrix>
251      */
252     public void setMatrixes(Collection<Matrix> matrixesIn)
253     {
254         this.matrixes = matrixesIn;
255     }
256 
257     /**
258      * Support utilisé pour mesurer un paramètre.
259      * @param elementToAdd Matrix
260      * @return <tt>true</tt> if this collection changed as a result of the
261      *         call
262      */
263     public boolean addMatrixes(Matrix elementToAdd)
264     {
265         return this.matrixes.add(elementToAdd);
266     }
267 
268     /**
269      * Support utilisé pour mesurer un paramètre.
270      * @param elementToRemove Matrix
271      * @return <tt>true</tt> if this collection changed as a result of the
272      *         call
273      */
274     public boolean removeMatrixes(Matrix elementToRemove)
275     {
276         return this.matrixes.remove(elementToRemove);
277     }
278 
279     private Collection<SandreFractionImp> sandreFractionImpIds = new HashSet<SandreFractionImp>();
280 
281     /**
282      * Fraction SANDRE pour les imports de données
283      * @return this.sandreFractionImpIds Collection<SandreFractionImp>
284      */
285     public Collection<SandreFractionImp> getSandreFractionImpIds()
286     {
287         return this.sandreFractionImpIds;
288     }
289 
290     /**
291      * Fraction SANDRE pour les imports de données
292      * @param sandreFractionImpIdsIn Collection<SandreFractionImp>
293      */
294     public void setSandreFractionImpIds(Collection<SandreFractionImp> sandreFractionImpIdsIn)
295     {
296         this.sandreFractionImpIds = sandreFractionImpIdsIn;
297     }
298 
299     /**
300      * Fraction SANDRE pour les imports de données
301      * @param elementToAdd SandreFractionImp
302      * @return <tt>true</tt> if this collection changed as a result of the
303      *         call
304      */
305     public boolean addSandreFractionImpIds(SandreFractionImp elementToAdd)
306     {
307         return this.sandreFractionImpIds.add(elementToAdd);
308     }
309 
310     /**
311      * Fraction SANDRE pour les imports de données
312      * @param elementToRemove SandreFractionImp
313      * @return <tt>true</tt> if this collection changed as a result of the
314      *         call
315      */
316     public boolean removeSandreFractionImpIds(SandreFractionImp elementToRemove)
317     {
318         return this.sandreFractionImpIds.remove(elementToRemove);
319     }
320 
321     private Collection<Pmfm> pmfms = new HashSet<Pmfm>();
322 
323     /**
324      * Liste les quadruplets paramètre, méthode, support, fraction.
325      * @return this.pmfms Collection<Pmfm>
326      */
327     public Collection<Pmfm> getPmfms()
328     {
329         return this.pmfms;
330     }
331 
332     /**
333      * Liste les quadruplets paramètre, méthode, support, fraction.
334      * @param pmfmsIn Collection<Pmfm>
335      */
336     public void setPmfms(Collection<Pmfm> pmfmsIn)
337     {
338         this.pmfms = pmfmsIn;
339     }
340 
341     /**
342      * Liste les quadruplets paramètre, méthode, support, fraction.
343      * @param elementToAdd Pmfm
344      * @return <tt>true</tt> if this collection changed as a result of the
345      *         call
346      */
347     public boolean addPmfms(Pmfm elementToAdd)
348     {
349         return this.pmfms.add(elementToAdd);
350     }
351 
352     /**
353      * Liste les quadruplets paramètre, méthode, support, fraction.
354      * @param elementToRemove Pmfm
355      * @return <tt>true</tt> if this collection changed as a result of the
356      *         call
357      */
358     public boolean removePmfms(Pmfm elementToRemove)
359     {
360         return this.pmfms.remove(elementToRemove);
361     }
362 
363     private Status status;
364 
365     /**
366      * Liste des états possibles d'un objet.
367      * @return this.status Status
368      */
369     public Status getStatus()
370     {
371         return this.status;
372     }
373 
374     /**
375      * Liste des états possibles d'un objet.
376      * @param statusIn Status
377      */
378     public void setStatus(Status statusIn)
379     {
380         this.status = statusIn;
381     }
382 
383     /**
384      * Returns <code>true</code> if the argument is an Fraction instance and all identifiers for this entity
385      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
386      */
387     @Override
388     public boolean equals(Object object)
389     {
390         if (this == object)
391         {
392             return true;
393         }
394         if (!(object instanceof Fraction))
395         {
396             return false;
397         }
398         final Fraction that = (Fraction)object;
399         if (this.fractionId == null || that.getFractionId() == null || !this.fractionId.equals(that.getFractionId()))
400         {
401             return false;
402         }
403         return true;
404     }
405 
406     /**
407      * Returns a hash code based on this entity's identifiers.
408      */
409     @Override
410     public int hashCode()
411     {
412         int hashCode = 0;
413         hashCode = 29 * hashCode + (this.fractionId == null ? 0 : this.fractionId.hashCode());
414 
415         return hashCode;
416     }
417 
418     /**
419      * Constructs new instances of {@link Fraction}.
420      */
421     public static final class Factory
422     {
423         /**
424          * Constructs a new instance of {@link Fraction}.
425          * @return new FractionImpl()
426          */
427         public static Fraction newInstance()
428         {
429             return new FractionImpl();
430         }
431 
432         /**
433          * Constructs a new instance of {@link Fraction}, taking all required and/or
434          * read-only properties as arguments, except for identifiers.
435          * @param fractionNm String
436          * @param updateDt Timestamp
437          * @param status Status
438          * @return newInstance
439          */
440         public static Fraction newInstance(String fractionNm, Timestamp updateDt, Status status)
441         {
442             final Fraction entity = new FractionImpl();
443             entity.setFractionNm(fractionNm);
444             entity.setUpdateDt(updateDt);
445             entity.setStatus(status);
446             return entity;
447         }
448 
449         /**
450          * Constructs a new instance of {@link Fraction}, taking all possible properties
451          * (except the identifier(s))as arguments.
452          * @param fractionNm String
453          * @param fractionDc String
454          * @param fractionCreationDt Date
455          * @param updateDt Timestamp
456          * @param sandreFractionExpIds Collection<SandreFractionExp>
457          * @param pmfmMors Collection<PmfmMor>
458          * @param matrixes Collection<Matrix>
459          * @param sandreFractionImpIds Collection<SandreFractionImp>
460          * @param pmfms Collection<Pmfm>
461          * @param status Status
462          * @return newInstance Fraction
463          */
464         public static Fraction newInstance(String fractionNm, String fractionDc, Date fractionCreationDt, Timestamp updateDt, Collection<SandreFractionExp> sandreFractionExpIds, Collection<PmfmMor> pmfmMors, Collection<Matrix> matrixes, Collection<SandreFractionImp> sandreFractionImpIds, Collection<Pmfm> pmfms, Status status)
465         {
466             final Fraction entity = new FractionImpl();
467             entity.setFractionNm(fractionNm);
468             entity.setFractionDc(fractionDc);
469             entity.setFractionCreationDt(fractionCreationDt);
470             entity.setUpdateDt(updateDt);
471             entity.setSandreFractionExpIds(sandreFractionExpIds);
472             entity.setPmfmMors(pmfmMors);
473             entity.setMatrixes(matrixes);
474             entity.setSandreFractionImpIds(sandreFractionImpIds);
475             entity.setPmfms(pmfms);
476             entity.setStatus(status);
477             return entity;
478         }
479     }
480 
481     /**
482      * @see Comparable#compareTo
483      */
484     public int compareTo(Fraction o)
485     {
486         int cmp = 0;
487         if (this.getFractionId() != null)
488         {
489             cmp = this.getFractionId().compareTo(o.getFractionId());
490         }
491         else
492         {
493             if (this.getFractionNm() != null)
494             {
495                 cmp = (cmp != 0 ? cmp : this.getFractionNm().compareTo(o.getFractionNm()));
496             }
497             if (this.getFractionDc() != null)
498             {
499                 cmp = (cmp != 0 ? cmp : this.getFractionDc().compareTo(o.getFractionDc()));
500             }
501             if (this.getFractionCreationDt() != null)
502             {
503                 cmp = (cmp != 0 ? cmp : this.getFractionCreationDt().compareTo(o.getFractionCreationDt()));
504             }
505             if (this.getUpdateDt() != null)
506             {
507                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
508             }
509         }
510         return cmp;
511     }
512 // HibernateEntity.vsl merge-point
513 // Fraction.java merge-point
514 }