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.administration.program.PmfmMor;
30 import fr.ifremer.quadrige2.core.dao.referential.Status;
31 import fr.ifremer.quadrige2.core.dao.sandre.SandreMatrixExp;
32 import fr.ifremer.quadrige2.core.dao.sandre.SandreMatrixImp;
33 import java.io.Serializable;
34 import java.sql.Timestamp;
35 import java.util.Collection;
36 import java.util.Date;
37 import java.util.HashSet;
38
39 /**
40 * Support utilisé pour mesurer un paramètre.
41 */
42 // HibernateEntity.vsl annotations merge-point
43 public abstract class Matrix
44 implements Serializable, Comparable<Matrix>
45 {
46 /**
47 * The serial version UID of this class. Needed for serialization.
48 */
49 private static final long serialVersionUID = -463569381304079176L;
50
51 // Generate 5 attributes
52 private Integer matrixId;
53
54 /**
55 * Identifiant interne du support
56 * @return this.matrixId Integer
57 */
58 public Integer getMatrixId()
59 {
60 return this.matrixId;
61 }
62
63 /**
64 * Identifiant interne du support
65 * @param matrixIdIn Integer
66 */
67 public void setMatrixId(Integer matrixIdIn)
68 {
69 this.matrixId = matrixIdIn;
70 }
71
72 private String matrixNm;
73
74 /**
75 * Libellé du support
76 * @return this.matrixNm String
77 */
78 public String getMatrixNm()
79 {
80 return this.matrixNm;
81 }
82
83 /**
84 * Libellé du support
85 * @param matrixNmIn String
86 */
87 public void setMatrixNm(String matrixNmIn)
88 {
89 this.matrixNm = matrixNmIn;
90 }
91
92 private String matrixDc;
93
94 /**
95 * Description du support
96 * @return this.matrixDc String
97 */
98 public String getMatrixDc()
99 {
100 return this.matrixDc;
101 }
102
103 /**
104 * Description du support
105 * @param matrixDcIn String
106 */
107 public void setMatrixDc(String matrixDcIn)
108 {
109 this.matrixDc = matrixDcIn;
110 }
111
112 private Date matrixCreationDt;
113
114 /**
115 * Date de création du support
116 * @return this.matrixCreationDt Date
117 */
118 public Date getMatrixCreationDt()
119 {
120 return this.matrixCreationDt;
121 }
122
123 /**
124 * Date de création du support
125 * @param matrixCreationDtIn Date
126 */
127 public void setMatrixCreationDt(Date matrixCreationDtIn)
128 {
129 this.matrixCreationDt = matrixCreationDtIn;
130 }
131
132 private Timestamp updateDt;
133
134 /**
135 * Date de maj du support
136 * @return this.updateDt Timestamp
137 */
138 public Timestamp getUpdateDt()
139 {
140 return this.updateDt;
141 }
142
143 /**
144 * Date de maj du support
145 * @param updateDtIn Timestamp
146 */
147 public void setUpdateDt(Timestamp updateDtIn)
148 {
149 this.updateDt = updateDtIn;
150 }
151
152 // Generate 9 associations
153 private Collection<Pmfm> pmfms = new HashSet<Pmfm>();
154
155 /**
156 * Liste les quadruplets paramètre, méthode, support, fraction.
157 * @return this.pmfms Collection<Pmfm>
158 */
159 public Collection<Pmfm> getPmfms()
160 {
161 return this.pmfms;
162 }
163
164 /**
165 * Liste les quadruplets paramètre, méthode, support, fraction.
166 * @param pmfmsIn Collection<Pmfm>
167 */
168 public void setPmfms(Collection<Pmfm> pmfmsIn)
169 {
170 this.pmfms = pmfmsIn;
171 }
172
173 /**
174 * Liste les quadruplets paramètre, méthode, support, fraction.
175 * @param elementToAdd Pmfm
176 * @return <tt>true</tt> if this collection changed as a result of the
177 * call
178 */
179 public boolean addPmfms(Pmfm elementToAdd)
180 {
181 return this.pmfms.add(elementToAdd);
182 }
183
184 /**
185 * Liste les quadruplets paramètre, méthode, support, fraction.
186 * @param elementToRemove Pmfm
187 * @return <tt>true</tt> if this collection changed as a result of the
188 * call
189 */
190 public boolean removePmfms(Pmfm elementToRemove)
191 {
192 return this.pmfms.remove(elementToRemove);
193 }
194
195 private Collection<SandreMatrixExp> sandreMatrixExpIds = new HashSet<SandreMatrixExp>();
196
197 /**
198 * Support sandre pour les exports de données
199 * @return this.sandreMatrixExpIds Collection<SandreMatrixExp>
200 */
201 public Collection<SandreMatrixExp> getSandreMatrixExpIds()
202 {
203 return this.sandreMatrixExpIds;
204 }
205
206 /**
207 * Support sandre pour les exports de données
208 * @param sandreMatrixExpIdsIn Collection<SandreMatrixExp>
209 */
210 public void setSandreMatrixExpIds(Collection<SandreMatrixExp> sandreMatrixExpIdsIn)
211 {
212 this.sandreMatrixExpIds = sandreMatrixExpIdsIn;
213 }
214
215 /**
216 * Support sandre pour les exports de données
217 * @param elementToAdd SandreMatrixExp
218 * @return <tt>true</tt> if this collection changed as a result of the
219 * call
220 */
221 public boolean addSandreMatrixExpIds(SandreMatrixExp elementToAdd)
222 {
223 return this.sandreMatrixExpIds.add(elementToAdd);
224 }
225
226 /**
227 * Support sandre pour les exports de données
228 * @param elementToRemove SandreMatrixExp
229 * @return <tt>true</tt> if this collection changed as a result of the
230 * call
231 */
232 public boolean removeSandreMatrixExpIds(SandreMatrixExp elementToRemove)
233 {
234 return this.sandreMatrixExpIds.remove(elementToRemove);
235 }
236
237 private Collection<Fraction> fractions = new HashSet<Fraction>();
238
239 /**
240 * Liste les fractions (compléter la description).
241 * @return this.fractions Collection<Fraction>
242 */
243 public Collection<Fraction> getFractions()
244 {
245 return this.fractions;
246 }
247
248 /**
249 * Liste les fractions (compléter la description).
250 * @param fractionsIn Collection<Fraction>
251 */
252 public void setFractions(Collection<Fraction> fractionsIn)
253 {
254 this.fractions = fractionsIn;
255 }
256
257 /**
258 * Liste les fractions (compléter la description).
259 * @param elementToAdd Fraction
260 * @return <tt>true</tt> if this collection changed as a result of the
261 * call
262 */
263 public boolean addFractions(Fraction elementToAdd)
264 {
265 return this.fractions.add(elementToAdd);
266 }
267
268 /**
269 * Liste les fractions (compléter la description).
270 * @param elementToRemove Fraction
271 * @return <tt>true</tt> if this collection changed as a result of the
272 * call
273 */
274 public boolean removeFractions(Fraction elementToRemove)
275 {
276 return this.fractions.remove(elementToRemove);
277 }
278
279 private Collection<SandreMatrixImp> sandreMatrixImpIds = new HashSet<SandreMatrixImp>();
280
281 /**
282 * Support sandre pour les imports de données
283 * @return this.sandreMatrixImpIds Collection<SandreMatrixImp>
284 */
285 public Collection<SandreMatrixImp> getSandreMatrixImpIds()
286 {
287 return this.sandreMatrixImpIds;
288 }
289
290 /**
291 * Support sandre pour les imports de données
292 * @param sandreMatrixImpIdsIn Collection<SandreMatrixImp>
293 */
294 public void setSandreMatrixImpIds(Collection<SandreMatrixImp> sandreMatrixImpIdsIn)
295 {
296 this.sandreMatrixImpIds = sandreMatrixImpIdsIn;
297 }
298
299 /**
300 * Support sandre pour les imports de données
301 * @param elementToAdd SandreMatrixImp
302 * @return <tt>true</tt> if this collection changed as a result of the
303 * call
304 */
305 public boolean addSandreMatrixImpIds(SandreMatrixImp elementToAdd)
306 {
307 return this.sandreMatrixImpIds.add(elementToAdd);
308 }
309
310 /**
311 * Support sandre pour les imports de données
312 * @param elementToRemove SandreMatrixImp
313 * @return <tt>true</tt> if this collection changed as a result of the
314 * call
315 */
316 public boolean removeSandreMatrixImpIds(SandreMatrixImp elementToRemove)
317 {
318 return this.sandreMatrixImpIds.remove(elementToRemove);
319 }
320
321 private Status status;
322
323 /**
324 * Liste des états possibles d'un objet.
325 * @return this.status Status
326 */
327 public Status getStatus()
328 {
329 return this.status;
330 }
331
332 /**
333 * Liste des états possibles d'un objet.
334 * @param statusIn Status
335 */
336 public void setStatus(Status statusIn)
337 {
338 this.status = statusIn;
339 }
340
341 private Collection<PmfmMor> pmfmMors = new HashSet<PmfmMor>();
342
343 /**
344 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
345 * @return this.pmfmMors Collection<PmfmMor>
346 */
347 public Collection<PmfmMor> getPmfmMors()
348 {
349 return this.pmfmMors;
350 }
351
352 /**
353 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
354 * @param pmfmMorsIn Collection<PmfmMor>
355 */
356 public void setPmfmMors(Collection<PmfmMor> pmfmMorsIn)
357 {
358 this.pmfmMors = pmfmMorsIn;
359 }
360
361 /**
362 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
363 * @param elementToAdd PmfmMor
364 * @return <tt>true</tt> if this collection changed as a result of the
365 * call
366 */
367 public boolean addPmfmMors(PmfmMor elementToAdd)
368 {
369 return this.pmfmMors.add(elementToAdd);
370 }
371
372 /**
373 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
374 * @param elementToRemove PmfmMor
375 * @return <tt>true</tt> if this collection changed as a result of the
376 * call
377 */
378 public boolean removePmfmMors(PmfmMor elementToRemove)
379 {
380 return this.pmfmMors.remove(elementToRemove);
381 }
382
383 /**
384 * Returns <code>true</code> if the argument is an Matrix instance and all identifiers for this entity
385 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
386 */
387 @Override
388 public boolean equals(Object object)
389 {
390 if (this == object)
391 {
392 return true;
393 }
394 if (!(object instanceof Matrix))
395 {
396 return false;
397 }
398 final Matrix that = (Matrix)object;
399 if (this.matrixId == null || that.getMatrixId() == null || !this.matrixId.equals(that.getMatrixId()))
400 {
401 return false;
402 }
403 return true;
404 }
405
406 /**
407 * Returns a hash code based on this entity's identifiers.
408 */
409 @Override
410 public int hashCode()
411 {
412 int hashCode = 0;
413 hashCode = 29 * hashCode + (this.matrixId == null ? 0 : this.matrixId.hashCode());
414
415 return hashCode;
416 }
417
418 /**
419 * Constructs new instances of {@link Matrix}.
420 */
421 public static final class Factory
422 {
423 /**
424 * Constructs a new instance of {@link Matrix}.
425 * @return new MatrixImpl()
426 */
427 public static Matrix newInstance()
428 {
429 return new MatrixImpl();
430 }
431
432 /**
433 * Constructs a new instance of {@link Matrix}, taking all required and/or
434 * read-only properties as arguments, except for identifiers.
435 * @param matrixNm String
436 * @param updateDt Timestamp
437 * @param status Status
438 * @return newInstance
439 */
440 public static Matrix newInstance(String matrixNm, Timestamp updateDt, Status status)
441 {
442 final Matrix entity = new MatrixImpl();
443 entity.setMatrixNm(matrixNm);
444 entity.setUpdateDt(updateDt);
445 entity.setStatus(status);
446 return entity;
447 }
448
449 /**
450 * Constructs a new instance of {@link Matrix}, taking all possible properties
451 * (except the identifier(s))as arguments.
452 * @param matrixNm String
453 * @param matrixDc String
454 * @param matrixCreationDt Date
455 * @param updateDt Timestamp
456 * @param pmfms Collection<Pmfm>
457 * @param sandreMatrixExpIds Collection<SandreMatrixExp>
458 * @param fractions Collection<Fraction>
459 * @param sandreMatrixImpIds Collection<SandreMatrixImp>
460 * @param status Status
461 * @param pmfmMors Collection<PmfmMor>
462 * @return newInstance Matrix
463 */
464 public static Matrix newInstance(String matrixNm, String matrixDc, Date matrixCreationDt, Timestamp updateDt, Collection<Pmfm> pmfms, Collection<SandreMatrixExp> sandreMatrixExpIds, Collection<Fraction> fractions, Collection<SandreMatrixImp> sandreMatrixImpIds, Status status, Collection<PmfmMor> pmfmMors)
465 {
466 final Matrix entity = new MatrixImpl();
467 entity.setMatrixNm(matrixNm);
468 entity.setMatrixDc(matrixDc);
469 entity.setMatrixCreationDt(matrixCreationDt);
470 entity.setUpdateDt(updateDt);
471 entity.setPmfms(pmfms);
472 entity.setSandreMatrixExpIds(sandreMatrixExpIds);
473 entity.setFractions(fractions);
474 entity.setSandreMatrixImpIds(sandreMatrixImpIds);
475 entity.setStatus(status);
476 entity.setPmfmMors(pmfmMors);
477 return entity;
478 }
479 }
480
481 /**
482 * @see Comparable#compareTo
483 */
484 public int compareTo(Matrix o)
485 {
486 int cmp = 0;
487 if (this.getMatrixId() != null)
488 {
489 cmp = this.getMatrixId().compareTo(o.getMatrixId());
490 }
491 else
492 {
493 if (this.getMatrixNm() != null)
494 {
495 cmp = (cmp != 0 ? cmp : this.getMatrixNm().compareTo(o.getMatrixNm()));
496 }
497 if (this.getMatrixDc() != null)
498 {
499 cmp = (cmp != 0 ? cmp : this.getMatrixDc().compareTo(o.getMatrixDc()));
500 }
501 if (this.getMatrixCreationDt() != null)
502 {
503 cmp = (cmp != 0 ? cmp : this.getMatrixCreationDt().compareTo(o.getMatrixCreationDt()));
504 }
505 if (this.getUpdateDt() != null)
506 {
507 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
508 }
509 }
510 return cmp;
511 }
512 // HibernateEntity.vsl merge-point
513 // Matrix.java merge-point
514 }