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.referential.pmfm;
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.referential.Status;
29  import java.io.Serializable;
30  import java.sql.Timestamp;
31  import java.util.Collection;
32  import java.util.Date;
33  import java.util.HashSet;
34  
35  /**
36   * Liste les fractions (compléter la description).
37   */
38  // HibernateEntity.vsl annotations merge-point
39  public abstract class Fraction
40      implements Serializable, Comparable<Fraction>
41  {
42      /**
43       * The serial version UID of this class. Needed for serialization.
44       */
45      private static final long serialVersionUID = -2623646185397189514L;
46  
47      // Generate 6 attributes
48      private Integer fractionId;
49  
50      /**
51       * Identifiant interne de la fraction
52       * @return this.fractionId Integer
53       */
54      public Integer getFractionId()
55      {
56          return this.fractionId;
57      }
58  
59      /**
60       * Identifiant interne de la fraction
61       * @param fractionIdIn Integer
62       */
63      public void setFractionId(Integer fractionIdIn)
64      {
65          this.fractionId = fractionIdIn;
66      }
67  
68      private String fractionNm;
69  
70      /**
71       * Libellé de la fraction
72       * @return this.fractionNm String
73       */
74      public String getFractionNm()
75      {
76          return this.fractionNm;
77      }
78  
79      /**
80       * Libellé de la fraction
81       * @param fractionNmIn String
82       */
83      public void setFractionNm(String fractionNmIn)
84      {
85          this.fractionNm = fractionNmIn;
86      }
87  
88      private String fractionDc;
89  
90      /**
91       * Description de la fraction
92       * @return this.fractionDc String
93       */
94      public String getFractionDc()
95      {
96          return this.fractionDc;
97      }
98  
99      /**
100      * Description de la fraction
101      * @param fractionDcIn String
102      */
103     public void setFractionDc(String fractionDcIn)
104     {
105         this.fractionDc = fractionDcIn;
106     }
107 
108     private Date fractionCreationDt;
109 
110     /**
111      * Date de création de la fraction
112      * @return this.fractionCreationDt Date
113      */
114     public Date getFractionCreationDt()
115     {
116         return this.fractionCreationDt;
117     }
118 
119     /**
120      * Date de création de la fraction
121      * @param fractionCreationDtIn Date
122      */
123     public void setFractionCreationDt(Date fractionCreationDtIn)
124     {
125         this.fractionCreationDt = fractionCreationDtIn;
126     }
127 
128     private Timestamp updateDt;
129 
130     /**
131      * Date de mise à jour de la fraction
132      * @return this.updateDt Timestamp
133      */
134     public Timestamp getUpdateDt()
135     {
136         return this.updateDt;
137     }
138 
139     /**
140      * Date de mise à jour de la fraction
141      * @param updateDtIn Timestamp
142      */
143     public void setUpdateDt(Timestamp updateDtIn)
144     {
145         this.updateDt = updateDtIn;
146     }
147 
148     private String fractionCm;
149 
150     /**
151      * 
152      * @return this.fractionCm String
153      */
154     public String getFractionCm()
155     {
156         return this.fractionCm;
157     }
158 
159     /**
160      * 
161      * @param fractionCmIn String
162      */
163     public void setFractionCm(String fractionCmIn)
164     {
165         this.fractionCm = fractionCmIn;
166     }
167 
168     // Generate 6 associations
169     private Collection<Matrix> matrixes = new HashSet<Matrix>();
170 
171     /**
172      * Support utilisé pour mesurer un paramètre.
173      * @return this.matrixes Collection<Matrix>
174      */
175     public Collection<Matrix> getMatrixes()
176     {
177         return this.matrixes;
178     }
179 
180     /**
181      * Support utilisé pour mesurer un paramètre.
182      * @param matrixesIn Collection<Matrix>
183      */
184     public void setMatrixes(Collection<Matrix> matrixesIn)
185     {
186         this.matrixes = matrixesIn;
187     }
188 
189     /**
190      * Support utilisé pour mesurer un paramètre.
191      * @param elementToAdd Matrix
192      * @return <tt>true</tt> if this collection changed as a result of the
193      *         call
194      */
195     public boolean addMatrixes(Matrix elementToAdd)
196     {
197         return this.matrixes.add(elementToAdd);
198     }
199 
200     /**
201      * Support utilisé pour mesurer un paramètre.
202      * @param elementToRemove Matrix
203      * @return <tt>true</tt> if this collection changed as a result of the
204      *         call
205      */
206     public boolean removeMatrixes(Matrix elementToRemove)
207     {
208         return this.matrixes.remove(elementToRemove);
209     }
210 
211     private Collection<Pmfm> pmfms = new HashSet<Pmfm>();
212 
213     /**
214      * Liste les quadruplets paramètre, méthode, support, fraction.
215      * @return this.pmfms Collection<Pmfm>
216      */
217     public Collection<Pmfm> getPmfms()
218     {
219         return this.pmfms;
220     }
221 
222     /**
223      * Liste les quadruplets paramètre, méthode, support, fraction.
224      * @param pmfmsIn Collection<Pmfm>
225      */
226     public void setPmfms(Collection<Pmfm> pmfmsIn)
227     {
228         this.pmfms = pmfmsIn;
229     }
230 
231     /**
232      * Liste les quadruplets paramètre, méthode, support, fraction.
233      * @param elementToAdd Pmfm
234      * @return <tt>true</tt> if this collection changed as a result of the
235      *         call
236      */
237     public boolean addPmfms(Pmfm elementToAdd)
238     {
239         return this.pmfms.add(elementToAdd);
240     }
241 
242     /**
243      * Liste les quadruplets paramètre, méthode, support, fraction.
244      * @param elementToRemove Pmfm
245      * @return <tt>true</tt> if this collection changed as a result of the
246      *         call
247      */
248     public boolean removePmfms(Pmfm elementToRemove)
249     {
250         return this.pmfms.remove(elementToRemove);
251     }
252 
253     private Status status;
254 
255     /**
256      * Liste des états possibles d'un objet.
257      * @return this.status Status
258      */
259     public Status getStatus()
260     {
261         return this.status;
262     }
263 
264     /**
265      * Liste des états possibles d'un objet.
266      * @param statusIn Status
267      */
268     public void setStatus(Status statusIn)
269     {
270         this.status = statusIn;
271     }
272 
273     /**
274      * Returns <code>true</code> if the argument is an Fraction instance and all identifiers for this entity
275      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
276      */
277     @Override
278     public boolean equals(Object object)
279     {
280         if (this == object)
281         {
282             return true;
283         }
284         if (!(object instanceof Fraction))
285         {
286             return false;
287         }
288         final Fraction that = (Fraction)object;
289         if (this.fractionId == null || that.getFractionId() == null || !this.fractionId.equals(that.getFractionId()))
290         {
291             return false;
292         }
293         return true;
294     }
295 
296     /**
297      * Returns a hash code based on this entity's identifiers.
298      */
299     @Override
300     public int hashCode()
301     {
302         int hashCode = 0;
303         hashCode = 29 * hashCode + (this.fractionId == null ? 0 : this.fractionId.hashCode());
304 
305         return hashCode;
306     }
307 
308     /**
309      * Constructs new instances of {@link Fraction}.
310      */
311     public static final class Factory
312     {
313         /**
314          * Constructs a new instance of {@link Fraction}.
315          * @return new FractionImpl()
316          */
317         public static Fraction newInstance()
318         {
319             return new FractionImpl();
320         }
321 
322         /**
323          * Constructs a new instance of {@link Fraction}, taking all required and/or
324          * read-only properties as arguments, except for identifiers.
325          * @param fractionNm String
326          * @param status Status
327          * @return newInstance
328          */
329         public static Fraction newInstance(String fractionNm, Status status)
330         {
331             final Fraction entity = new FractionImpl();
332             entity.setFractionNm(fractionNm);
333             entity.setStatus(status);
334             return entity;
335         }
336 
337         /**
338          * Constructs a new instance of {@link Fraction}, taking all possible properties
339          * (except the identifier(s))as arguments.
340          * @param fractionNm String
341          * @param fractionDc String
342          * @param fractionCreationDt Date
343          * @param updateDt Timestamp
344          * @param fractionCm String
345          * @param matrixes Collection<Matrix>
346          * @param pmfms Collection<Pmfm>
347          * @param status Status
348          * @return newInstance Fraction
349          */
350         public static Fraction newInstance(String fractionNm, String fractionDc, Date fractionCreationDt, Timestamp updateDt, String fractionCm, Collection<Matrix> matrixes, Collection<Pmfm> pmfms, Status status)
351         {
352             final Fraction entity = new FractionImpl();
353             entity.setFractionNm(fractionNm);
354             entity.setFractionDc(fractionDc);
355             entity.setFractionCreationDt(fractionCreationDt);
356             entity.setUpdateDt(updateDt);
357             entity.setFractionCm(fractionCm);
358             entity.setMatrixes(matrixes);
359             entity.setPmfms(pmfms);
360             entity.setStatus(status);
361             return entity;
362         }
363     }
364 
365     /**
366      * @see Comparable#compareTo
367      */
368     public int compareTo(Fraction o)
369     {
370         int cmp = 0;
371         if (this.getFractionId() != null)
372         {
373             cmp = this.getFractionId().compareTo(o.getFractionId());
374         }
375         else
376         {
377             if (this.getFractionNm() != null)
378             {
379                 cmp = (cmp != 0 ? cmp : this.getFractionNm().compareTo(o.getFractionNm()));
380             }
381             if (this.getFractionDc() != null)
382             {
383                 cmp = (cmp != 0 ? cmp : this.getFractionDc().compareTo(o.getFractionDc()));
384             }
385             if (this.getFractionCreationDt() != null)
386             {
387                 cmp = (cmp != 0 ? cmp : this.getFractionCreationDt().compareTo(o.getFractionCreationDt()));
388             }
389             if (this.getUpdateDt() != null)
390             {
391                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
392             }
393             if (this.getFractionCm() != null)
394             {
395                 cmp = (cmp != 0 ? cmp : this.getFractionCm().compareTo(o.getFractionCm()));
396             }
397         }
398         return cmp;
399     }
400 // HibernateEntity.vsl merge-point
401 // Fraction.java merge-point
402 }