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 * Support utilisé pour mesurer un paramètre.
37 */
38 // HibernateEntity.vsl annotations merge-point
39 public abstract class Matrix
40 implements Serializable, Comparable<Matrix>
41 {
42 /**
43 * The serial version UID of this class. Needed for serialization.
44 */
45 private static final long serialVersionUID = 5184077680699660582L;
46
47 // Generate 6 attributes
48 private Integer matrixId;
49
50 /**
51 * Identifiant interne du support
52 * @return this.matrixId Integer
53 */
54 public Integer getMatrixId()
55 {
56 return this.matrixId;
57 }
58
59 /**
60 * Identifiant interne du support
61 * @param matrixIdIn Integer
62 */
63 public void setMatrixId(Integer matrixIdIn)
64 {
65 this.matrixId = matrixIdIn;
66 }
67
68 private String matrixNm;
69
70 /**
71 * Libellé du support
72 * @return this.matrixNm String
73 */
74 public String getMatrixNm()
75 {
76 return this.matrixNm;
77 }
78
79 /**
80 * Libellé du support
81 * @param matrixNmIn String
82 */
83 public void setMatrixNm(String matrixNmIn)
84 {
85 this.matrixNm = matrixNmIn;
86 }
87
88 private String matrixDc;
89
90 /**
91 * Description du support
92 * @return this.matrixDc String
93 */
94 public String getMatrixDc()
95 {
96 return this.matrixDc;
97 }
98
99 /**
100 * Description du support
101 * @param matrixDcIn String
102 */
103 public void setMatrixDc(String matrixDcIn)
104 {
105 this.matrixDc = matrixDcIn;
106 }
107
108 private Date matrixCreationDt;
109
110 /**
111 * Date de création du support
112 * @return this.matrixCreationDt Date
113 */
114 public Date getMatrixCreationDt()
115 {
116 return this.matrixCreationDt;
117 }
118
119 /**
120 * Date de création du support
121 * @param matrixCreationDtIn Date
122 */
123 public void setMatrixCreationDt(Date matrixCreationDtIn)
124 {
125 this.matrixCreationDt = matrixCreationDtIn;
126 }
127
128 private Timestamp updateDt;
129
130 /**
131 * Date de maj du support
132 * @return this.updateDt Timestamp
133 */
134 public Timestamp getUpdateDt()
135 {
136 return this.updateDt;
137 }
138
139 /**
140 * Date de maj du support
141 * @param updateDtIn Timestamp
142 */
143 public void setUpdateDt(Timestamp updateDtIn)
144 {
145 this.updateDt = updateDtIn;
146 }
147
148 private String matrixCm;
149
150 /**
151 *
152 * @return this.matrixCm String
153 */
154 public String getMatrixCm()
155 {
156 return this.matrixCm;
157 }
158
159 /**
160 *
161 * @param matrixCmIn String
162 */
163 public void setMatrixCm(String matrixCmIn)
164 {
165 this.matrixCm = matrixCmIn;
166 }
167
168 // Generate 7 associations
169 private Collection<Pmfm> pmfms = new HashSet<Pmfm>();
170
171 /**
172 * Liste les quadruplets paramètre, méthode, support, fraction.
173 * @return this.pmfms Collection<Pmfm>
174 */
175 public Collection<Pmfm> getPmfms()
176 {
177 return this.pmfms;
178 }
179
180 /**
181 * Liste les quadruplets paramètre, méthode, support, fraction.
182 * @param pmfmsIn Collection<Pmfm>
183 */
184 public void setPmfms(Collection<Pmfm> pmfmsIn)
185 {
186 this.pmfms = pmfmsIn;
187 }
188
189 /**
190 * Liste les quadruplets paramètre, méthode, support, fraction.
191 * @param elementToAdd Pmfm
192 * @return <tt>true</tt> if this collection changed as a result of the
193 * call
194 */
195 public boolean addPmfms(Pmfm elementToAdd)
196 {
197 return this.pmfms.add(elementToAdd);
198 }
199
200 /**
201 * Liste les quadruplets paramètre, méthode, support, fraction.
202 * @param elementToRemove Pmfm
203 * @return <tt>true</tt> if this collection changed as a result of the
204 * call
205 */
206 public boolean removePmfms(Pmfm elementToRemove)
207 {
208 return this.pmfms.remove(elementToRemove);
209 }
210
211 private Collection<Fraction> fractions = new HashSet<Fraction>();
212
213 /**
214 * Liste les fractions (compléter la description).
215 * @return this.fractions Collection<Fraction>
216 */
217 public Collection<Fraction> getFractions()
218 {
219 return this.fractions;
220 }
221
222 /**
223 * Liste les fractions (compléter la description).
224 * @param fractionsIn Collection<Fraction>
225 */
226 public void setFractions(Collection<Fraction> fractionsIn)
227 {
228 this.fractions = fractionsIn;
229 }
230
231 /**
232 * Liste les fractions (compléter la description).
233 * @param elementToAdd Fraction
234 * @return <tt>true</tt> if this collection changed as a result of the
235 * call
236 */
237 public boolean addFractions(Fraction elementToAdd)
238 {
239 return this.fractions.add(elementToAdd);
240 }
241
242 /**
243 * Liste les fractions (compléter la description).
244 * @param elementToRemove Fraction
245 * @return <tt>true</tt> if this collection changed as a result of the
246 * call
247 */
248 public boolean removeFractions(Fraction elementToRemove)
249 {
250 return this.fractions.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 Matrix 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 Matrix))
285 {
286 return false;
287 }
288 final Matrix that = (Matrix)object;
289 if (this.matrixId == null || that.getMatrixId() == null || !this.matrixId.equals(that.getMatrixId()))
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.matrixId == null ? 0 : this.matrixId.hashCode());
304
305 return hashCode;
306 }
307
308 /**
309 * Constructs new instances of {@link Matrix}.
310 */
311 public static final class Factory
312 {
313 /**
314 * Constructs a new instance of {@link Matrix}.
315 * @return new MatrixImpl()
316 */
317 public static Matrix newInstance()
318 {
319 return new MatrixImpl();
320 }
321
322 /**
323 * Constructs a new instance of {@link Matrix}, taking all required and/or
324 * read-only properties as arguments, except for identifiers.
325 * @param matrixNm String
326 * @param status Status
327 * @return newInstance
328 */
329 public static Matrix newInstance(String matrixNm, Status status)
330 {
331 final Matrix entity = new MatrixImpl();
332 entity.setMatrixNm(matrixNm);
333 entity.setStatus(status);
334 return entity;
335 }
336
337 /**
338 * Constructs a new instance of {@link Matrix}, taking all possible properties
339 * (except the identifier(s))as arguments.
340 * @param matrixNm String
341 * @param matrixDc String
342 * @param matrixCreationDt Date
343 * @param updateDt Timestamp
344 * @param matrixCm String
345 * @param pmfms Collection<Pmfm>
346 * @param fractions Collection<Fraction>
347 * @param status Status
348 * @return newInstance Matrix
349 */
350 public static Matrix newInstance(String matrixNm, String matrixDc, Date matrixCreationDt, Timestamp updateDt, String matrixCm, Collection<Pmfm> pmfms, Collection<Fraction> fractions, Status status)
351 {
352 final Matrix entity = new MatrixImpl();
353 entity.setMatrixNm(matrixNm);
354 entity.setMatrixDc(matrixDc);
355 entity.setMatrixCreationDt(matrixCreationDt);
356 entity.setUpdateDt(updateDt);
357 entity.setMatrixCm(matrixCm);
358 entity.setPmfms(pmfms);
359 entity.setFractions(fractions);
360 entity.setStatus(status);
361 return entity;
362 }
363 }
364
365 /**
366 * @see Comparable#compareTo
367 */
368 public int compareTo(Matrix o)
369 {
370 int cmp = 0;
371 if (this.getMatrixId() != null)
372 {
373 cmp = this.getMatrixId().compareTo(o.getMatrixId());
374 }
375 else
376 {
377 if (this.getMatrixNm() != null)
378 {
379 cmp = (cmp != 0 ? cmp : this.getMatrixNm().compareTo(o.getMatrixNm()));
380 }
381 if (this.getMatrixDc() != null)
382 {
383 cmp = (cmp != 0 ? cmp : this.getMatrixDc().compareTo(o.getMatrixDc()));
384 }
385 if (this.getMatrixCreationDt() != null)
386 {
387 cmp = (cmp != 0 ? cmp : this.getMatrixCreationDt().compareTo(o.getMatrixCreationDt()));
388 }
389 if (this.getUpdateDt() != null)
390 {
391 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
392 }
393 if (this.getMatrixCm() != null)
394 {
395 cmp = (cmp != 0 ? cmp : this.getMatrixCm().compareTo(o.getMatrixCm()));
396 }
397 }
398 return cmp;
399 }
400 // HibernateEntity.vsl merge-point
401 // Matrix.java merge-point
402 }