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.system;
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 java.io.Serializable;
30 import java.sql.Timestamp;
31
32 /**
33 * Contient les informations sur les mesures utilisées dans le calcul d'une mesure
34 */
35 // HibernateEntity.vsl annotations merge-point
36 public abstract class ComputeMeasurement
37 implements Serializable, Comparable<ComputeMeasurement>
38 {
39 /**
40 * The serial version UID of this class. Needed for serialization.
41 */
42 private static final long serialVersionUID = 7358143345844603802L;
43
44 // Generate 6 attributes
45 private Integer compMeasId;
46
47 /**
48 * Identifiant des informations sur le calcul
49 * @return this.compMeasId Integer
50 */
51 public Integer getCompMeasId()
52 {
53 return this.compMeasId;
54 }
55
56 /**
57 * Identifiant des informations sur le calcul
58 * @param compMeasIdIn Integer
59 */
60 public void setCompMeasId(Integer compMeasIdIn)
61 {
62 this.compMeasId = compMeasIdIn;
63 }
64
65 private Integer measId;
66
67 /**
68 * Identifiant interne du résultat calculé
69 * @return this.measId Integer
70 */
71 public Integer getMeasId()
72 {
73 return this.measId;
74 }
75
76 /**
77 * Identifiant interne du résultat calculé
78 * @param measIdIn Integer
79 */
80 public void setMeasId(Integer measIdIn)
81 {
82 this.measId = measIdIn;
83 }
84
85 private Integer taxonMeasId;
86
87 /**
88 * Identifiant interne du résultat de dénombrement calculé
89 * @return this.taxonMeasId Integer
90 */
91 public Integer getTaxonMeasId()
92 {
93 return this.taxonMeasId;
94 }
95
96 /**
97 * Identifiant interne du résultat de dénombrement calculé
98 * @param taxonMeasIdIn Integer
99 */
100 public void setTaxonMeasId(Integer taxonMeasIdIn)
101 {
102 this.taxonMeasId = taxonMeasIdIn;
103 }
104
105 private Integer depMeasId;
106
107 /**
108 * Identifiant interne du résultat intervenant dans le calcul
109 * @return this.depMeasId Integer
110 */
111 public Integer getDepMeasId()
112 {
113 return this.depMeasId;
114 }
115
116 /**
117 * Identifiant interne du résultat intervenant dans le calcul
118 * @param depMeasIdIn Integer
119 */
120 public void setDepMeasId(Integer depMeasIdIn)
121 {
122 this.depMeasId = depMeasIdIn;
123 }
124
125 private Integer depTaxonMeasId;
126
127 /**
128 * Identifiant interne du résultat de dénombrement intervenant dans le calcul
129 * @return this.depTaxonMeasId Integer
130 */
131 public Integer getDepTaxonMeasId()
132 {
133 return this.depTaxonMeasId;
134 }
135
136 /**
137 * Identifiant interne du résultat de dénombrement intervenant dans le calcul
138 * @param depTaxonMeasIdIn Integer
139 */
140 public void setDepTaxonMeasId(Integer depTaxonMeasIdIn)
141 {
142 this.depTaxonMeasId = depTaxonMeasIdIn;
143 }
144
145 private Timestamp updateDt;
146
147 /**
148 * Date de mise à jour
149 * @return this.updateDt Timestamp
150 */
151 public Timestamp getUpdateDt()
152 {
153 return this.updateDt;
154 }
155
156 /**
157 * Date de mise à jour
158 * @param updateDtIn Timestamp
159 */
160 public void setUpdateDt(Timestamp updateDtIn)
161 {
162 this.updateDt = updateDtIn;
163 }
164
165 // Generate 1 associations
166 private ComputeFunction compFunctionCd;
167
168 /**
169 * Contient les différentes fonction de calcul pour les paramètres
170 * @return this.compFunctionCd ComputeFunction
171 */
172 public ComputeFunction getCompFunctionCd()
173 {
174 return this.compFunctionCd;
175 }
176
177 /**
178 * Contient les différentes fonction de calcul pour les paramètres
179 * @param compFunctionCdIn ComputeFunction
180 */
181 public void setCompFunctionCd(ComputeFunction compFunctionCdIn)
182 {
183 this.compFunctionCd = compFunctionCdIn;
184 }
185
186 /**
187 * Returns <code>true</code> if the argument is an ComputeMeasurement instance and all identifiers for this entity
188 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
189 */
190 @Override
191 public boolean equals(Object object)
192 {
193 if (this == object)
194 {
195 return true;
196 }
197 if (!(object instanceof ComputeMeasurement))
198 {
199 return false;
200 }
201 final ComputeMeasurement that = (ComputeMeasurement)object;
202 if (this.compMeasId == null || that.getCompMeasId() == null || !this.compMeasId.equals(that.getCompMeasId()))
203 {
204 return false;
205 }
206 return true;
207 }
208
209 /**
210 * Returns a hash code based on this entity's identifiers.
211 */
212 @Override
213 public int hashCode()
214 {
215 int hashCode = 0;
216 hashCode = 29 * hashCode + (this.compMeasId == null ? 0 : this.compMeasId.hashCode());
217
218 return hashCode;
219 }
220
221 /**
222 * Constructs new instances of {@link ComputeMeasurement}.
223 */
224 public static final class Factory
225 {
226 /**
227 * Constructs a new instance of {@link ComputeMeasurement}.
228 * @return new ComputeMeasurementImpl()
229 */
230 public static ComputeMeasurement newInstance()
231 {
232 return new ComputeMeasurementImpl();
233 }
234
235 /**
236 * Constructs a new instance of {@link ComputeMeasurement}, taking all required and/or
237 * read-only properties as arguments, except for identifiers.
238 * @param updateDt Timestamp
239 * @param compFunctionCd ComputeFunction
240 * @return newInstance
241 */
242 public static ComputeMeasurement newInstance(Timestamp updateDt, ComputeFunction compFunctionCd)
243 {
244 final ComputeMeasurement entity = new ComputeMeasurementImpl();
245 entity.setUpdateDt(updateDt);
246 entity.setCompFunctionCd(compFunctionCd);
247 return entity;
248 }
249
250 /**
251 * Constructs a new instance of {@link ComputeMeasurement}, taking all possible properties
252 * (except the identifier(s))as arguments.
253 * @param measId Integer
254 * @param taxonMeasId Integer
255 * @param depMeasId Integer
256 * @param depTaxonMeasId Integer
257 * @param updateDt Timestamp
258 * @param compFunctionCd ComputeFunction
259 * @return newInstance ComputeMeasurement
260 */
261 public static ComputeMeasurement newInstance(Integer measId, Integer taxonMeasId, Integer depMeasId, Integer depTaxonMeasId, Timestamp updateDt, ComputeFunction compFunctionCd)
262 {
263 final ComputeMeasurement entity = new ComputeMeasurementImpl();
264 entity.setMeasId(measId);
265 entity.setTaxonMeasId(taxonMeasId);
266 entity.setDepMeasId(depMeasId);
267 entity.setDepTaxonMeasId(depTaxonMeasId);
268 entity.setUpdateDt(updateDt);
269 entity.setCompFunctionCd(compFunctionCd);
270 return entity;
271 }
272 }
273
274 /**
275 * @see Comparable#compareTo
276 */
277 public int compareTo(ComputeMeasurement o)
278 {
279 int cmp = 0;
280 if (this.getCompMeasId() != null)
281 {
282 cmp = this.getCompMeasId().compareTo(o.getCompMeasId());
283 }
284 else
285 {
286 if (this.getMeasId() != null)
287 {
288 cmp = (cmp != 0 ? cmp : this.getMeasId().compareTo(o.getMeasId()));
289 }
290 if (this.getTaxonMeasId() != null)
291 {
292 cmp = (cmp != 0 ? cmp : this.getTaxonMeasId().compareTo(o.getTaxonMeasId()));
293 }
294 if (this.getDepMeasId() != null)
295 {
296 cmp = (cmp != 0 ? cmp : this.getDepMeasId().compareTo(o.getDepMeasId()));
297 }
298 if (this.getDepTaxonMeasId() != null)
299 {
300 cmp = (cmp != 0 ? cmp : this.getDepTaxonMeasId().compareTo(o.getDepTaxonMeasId()));
301 }
302 if (this.getUpdateDt() != null)
303 {
304 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
305 }
306 }
307 return cmp;
308 }
309 // HibernateEntity.vsl merge-point
310 // ComputeMeasurement.java merge-point
311 }