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.aquaculture;
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.referential.Status;
30  import java.io.Serializable;
31  import java.sql.Timestamp;
32  
33  /**
34   * Classe d'âge d'une population initiale
35   */
36  // HibernateEntity.vsl annotations merge-point
37  public abstract class AgeGroup
38      implements Serializable, Comparable<AgeGroup>
39  {
40      /**
41       * The serial version UID of this class. Needed for serialization.
42       */
43      private static final long serialVersionUID = -818363897210850022L;
44  
45      // Generate 3 attributes
46      private String ageGroupCd;
47  
48      /**
49       * Code de la classe d'âge
50       * @return this.ageGroupCd String
51       */
52      public String getAgeGroupCd()
53      {
54          return this.ageGroupCd;
55      }
56  
57      /**
58       * Code de la classe d'âge
59       * @param ageGroupCdIn String
60       */
61      public void setAgeGroupCd(String ageGroupCdIn)
62      {
63          this.ageGroupCd = ageGroupCdIn;
64      }
65  
66      private String ageGroupNm;
67  
68      /**
69       * Libellé de la classe d'âge
70       * @return this.ageGroupNm String
71       */
72      public String getAgeGroupNm()
73      {
74          return this.ageGroupNm;
75      }
76  
77      /**
78       * Libellé de la classe d'âge
79       * @param ageGroupNmIn String
80       */
81      public void setAgeGroupNm(String ageGroupNmIn)
82      {
83          this.ageGroupNm = ageGroupNmIn;
84      }
85  
86      private Timestamp updateDt;
87  
88      /**
89       * Date de maj
90       * @return this.updateDt Timestamp
91       */
92      public Timestamp getUpdateDt()
93      {
94          return this.updateDt;
95      }
96  
97      /**
98       * Date de maj
99       * @param updateDtIn Timestamp
100      */
101     public void setUpdateDt(Timestamp updateDtIn)
102     {
103         this.updateDt = updateDtIn;
104     }
105 
106     // Generate 2 associations
107     private Status status;
108 
109     /**
110      * Liste des états possibles d'un objet.
111      * @return this.status Status
112      */
113     public Status getStatus()
114     {
115         return this.status;
116     }
117 
118     /**
119      * Liste des états possibles d'un objet.
120      * @param statusIn Status
121      */
122     public void setStatus(Status statusIn)
123     {
124         this.status = statusIn;
125     }
126 
127     /**
128      * Returns <code>true</code> if the argument is an AgeGroup instance and all identifiers for this entity
129      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
130      */
131     @Override
132     public boolean equals(Object object)
133     {
134         if (this == object)
135         {
136             return true;
137         }
138         if (!(object instanceof AgeGroup))
139         {
140             return false;
141         }
142         final AgeGroup that = (AgeGroup)object;
143         if (this.ageGroupCd == null || that.getAgeGroupCd() == null || !this.ageGroupCd.equals(that.getAgeGroupCd()))
144         {
145             return false;
146         }
147         return true;
148     }
149 
150     /**
151      * Returns a hash code based on this entity's identifiers.
152      */
153     @Override
154     public int hashCode()
155     {
156         int hashCode = 0;
157         hashCode = 29 * hashCode + (this.ageGroupCd == null ? 0 : this.ageGroupCd.hashCode());
158 
159         return hashCode;
160     }
161 
162     /**
163      * Constructs new instances of {@link AgeGroup}.
164      */
165     public static final class Factory
166     {
167         /**
168          * Constructs a new instance of {@link AgeGroup}.
169          * @return new AgeGroupImpl()
170          */
171         public static AgeGroup newInstance()
172         {
173             return new AgeGroupImpl();
174         }
175 
176 
177         /**
178          * Constructs a new instance of {@link AgeGroup}, taking all possible properties
179          * (except the identifier(s))as arguments.
180          * @param ageGroupNm String
181          * @param updateDt Timestamp
182          * @param status Status
183          * @return newInstance AgeGroup
184          */
185         public static AgeGroup newInstance(String ageGroupNm, Timestamp updateDt, Status status)
186         {
187             final AgeGroup entity = new AgeGroupImpl();
188             entity.setAgeGroupNm(ageGroupNm);
189             entity.setUpdateDt(updateDt);
190             entity.setStatus(status);
191             return entity;
192         }
193     }
194 
195     /**
196      * @see Comparable#compareTo
197      */
198     public int compareTo(AgeGroup o)
199     {
200         int cmp = 0;
201         if (this.getAgeGroupCd() != null)
202         {
203             cmp = this.getAgeGroupCd().compareTo(o.getAgeGroupCd());
204         }
205         else
206         {
207             if (this.getAgeGroupNm() != null)
208             {
209                 cmp = (cmp != 0 ? cmp : this.getAgeGroupNm().compareTo(o.getAgeGroupNm()));
210             }
211             if (this.getUpdateDt() != null)
212             {
213                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
214             }
215         }
216         return cmp;
217     }
218 // HibernateEntity.vsl merge-point
219 // AgeGroup.java merge-point
220 }