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