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  
32  /**
33   * Liste des valeurs qualitatives associées aux paramètres.
34   */
35  // HibernateEntity.vsl annotations merge-point
36  public abstract class QualitativeValue
37      implements Serializable, Comparable<QualitativeValue>
38  {
39      /**
40       * The serial version UID of this class. Needed for serialization.
41       */
42      private static final long serialVersionUID = -1714217518007423342L;
43  
44      // Generate 4 attributes
45      private Integer qualValueId;
46  
47      /**
48       * Identifiant unique due la valeur qualitative
49       * @return this.qualValueId Integer
50       */
51      public Integer getQualValueId()
52      {
53          return this.qualValueId;
54      }
55  
56      /**
57       * Identifiant unique due la valeur qualitative
58       * @param qualValueIdIn Integer
59       */
60      public void setQualValueId(Integer qualValueIdIn)
61      {
62          this.qualValueId = qualValueIdIn;
63      }
64  
65      private String qualValueNm;
66  
67      /**
68       * Libellé de la valeur qualitative
69       * @return this.qualValueNm String
70       */
71      public String getQualValueNm()
72      {
73          return this.qualValueNm;
74      }
75  
76      /**
77       * Libellé de la valeur qualitative
78       * @param qualValueNmIn String
79       */
80      public void setQualValueNm(String qualValueNmIn)
81      {
82          this.qualValueNm = qualValueNmIn;
83      }
84  
85      private String qualValueDc;
86  
87      /**
88       * Description de la valeur
89       * @return this.qualValueDc String
90       */
91      public String getQualValueDc()
92      {
93          return this.qualValueDc;
94      }
95  
96      /**
97       * Description de la valeur
98       * @param qualValueDcIn String
99       */
100     public void setQualValueDc(String qualValueDcIn)
101     {
102         this.qualValueDc = qualValueDcIn;
103     }
104 
105     private Timestamp updateDt;
106 
107     /**
108      * Date de modification de l'objet, mise à jour par le système
109      * @return this.updateDt Timestamp
110      */
111     public Timestamp getUpdateDt()
112     {
113         return this.updateDt;
114     }
115 
116     /**
117      * Date de modification de l'objet, mise à jour par le système
118      * @param updateDtIn Timestamp
119      */
120     public void setUpdateDt(Timestamp updateDtIn)
121     {
122         this.updateDt = updateDtIn;
123     }
124 
125     // Generate 6 associations
126     private Status status;
127 
128     /**
129      * Liste des états possibles d'un objet.
130      * @return this.status Status
131      */
132     public Status getStatus()
133     {
134         return this.status;
135     }
136 
137     /**
138      * Liste des états possibles d'un objet.
139      * @param statusIn Status
140      */
141     public void setStatus(Status statusIn)
142     {
143         this.status = statusIn;
144     }
145 
146     private Parameter parameter;
147 
148     /**
149      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
150      * @return this.parameter Parameter
151      */
152     public Parameter getParameter()
153     {
154         return this.parameter;
155     }
156 
157     /**
158      * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
159      * @param parameterIn Parameter
160      */
161     public void setParameter(Parameter parameterIn)
162     {
163         this.parameter = parameterIn;
164     }
165 
166     /**
167      * Returns <code>true</code> if the argument is an QualitativeValue instance and all identifiers for this entity
168      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
169      */
170     @Override
171     public boolean equals(Object object)
172     {
173         if (this == object)
174         {
175             return true;
176         }
177         if (!(object instanceof QualitativeValue))
178         {
179             return false;
180         }
181         final QualitativeValue that = (QualitativeValue)object;
182         if (this.qualValueId == null || that.getQualValueId() == null || !this.qualValueId.equals(that.getQualValueId()))
183         {
184             return false;
185         }
186         return true;
187     }
188 
189     /**
190      * Returns a hash code based on this entity's identifiers.
191      */
192     @Override
193     public int hashCode()
194     {
195         int hashCode = 0;
196         hashCode = 29 * hashCode + (this.qualValueId == null ? 0 : this.qualValueId.hashCode());
197 
198         return hashCode;
199     }
200 
201     /**
202      * Constructs new instances of {@link QualitativeValue}.
203      */
204     public static final class Factory
205     {
206         /**
207          * Constructs a new instance of {@link QualitativeValue}.
208          * @return new QualitativeValueImpl()
209          */
210         public static QualitativeValue newInstance()
211         {
212             return new QualitativeValueImpl();
213         }
214 
215         /**
216          * Constructs a new instance of {@link QualitativeValue}, taking all required and/or
217          * read-only properties as arguments, except for identifiers.
218          * @param qualValueNm String
219          * @param status Status
220          * @param parameter Parameter
221          * @return newInstance
222          */
223         public static QualitativeValue newInstance(String qualValueNm, Status status, Parameter parameter)
224         {
225             final QualitativeValue entity = new QualitativeValueImpl();
226             entity.setQualValueNm(qualValueNm);
227             entity.setStatus(status);
228             entity.setParameter(parameter);
229             return entity;
230         }
231 
232         /**
233          * Constructs a new instance of {@link QualitativeValue}, taking all possible properties
234          * (except the identifier(s))as arguments.
235          * @param qualValueNm String
236          * @param qualValueDc String
237          * @param updateDt Timestamp
238          * @param status Status
239          * @param parameter Parameter
240          * @return newInstance QualitativeValue
241          */
242         public static QualitativeValue newInstance(String qualValueNm, String qualValueDc, Timestamp updateDt, Status status, Parameter parameter)
243         {
244             final QualitativeValue entity = new QualitativeValueImpl();
245             entity.setQualValueNm(qualValueNm);
246             entity.setQualValueDc(qualValueDc);
247             entity.setUpdateDt(updateDt);
248             entity.setStatus(status);
249             entity.setParameter(parameter);
250             return entity;
251         }
252     }
253 
254     /**
255      * @see Comparable#compareTo
256      */
257     public int compareTo(QualitativeValue o)
258     {
259         int cmp = 0;
260         if (this.getQualValueId() != null)
261         {
262             cmp = this.getQualValueId().compareTo(o.getQualValueId());
263         }
264         else
265         {
266             if (this.getQualValueNm() != null)
267             {
268                 cmp = (cmp != 0 ? cmp : this.getQualValueNm().compareTo(o.getQualValueNm()));
269             }
270             if (this.getQualValueDc() != null)
271             {
272                 cmp = (cmp != 0 ? cmp : this.getQualValueDc().compareTo(o.getQualValueDc()));
273             }
274             if (this.getUpdateDt() != null)
275             {
276                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
277             }
278         }
279         return cmp;
280     }
281 // HibernateEntity.vsl merge-point
282 // QualitativeValue.java merge-point
283 }