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.SandreMethodExp;
32 import fr.ifremer.quadrige2.core.dao.sandre.SandreMethodImp;
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 * Méthode utilisée pour mesurer un paramètre.
41 */
42 // HibernateEntity.vsl annotations merge-point
43 public abstract class Method
44 implements Serializable, Comparable<Method>
45 {
46 /**
47 * The serial version UID of this class. Needed for serialization.
48 */
49 private static final long serialVersionUID = -163778324863342691L;
50
51 // Generate 11 attributes
52 private Integer methodId;
53
54 /**
55 * Identifiant interne de la méthode
56 * @return this.methodId Integer
57 */
58 public Integer getMethodId()
59 {
60 return this.methodId;
61 }
62
63 /**
64 * Identifiant interne de la méthode
65 * @param methodIdIn Integer
66 */
67 public void setMethodId(Integer methodIdIn)
68 {
69 this.methodId = methodIdIn;
70 }
71
72 private String methodNm;
73
74 /**
75 * Libellé de la méthode
76 * @return this.methodNm String
77 */
78 public String getMethodNm()
79 {
80 return this.methodNm;
81 }
82
83 /**
84 * Libellé de la méthode
85 * @param methodNmIn String
86 */
87 public void setMethodNm(String methodNmIn)
88 {
89 this.methodNm = methodNmIn;
90 }
91
92 private String methodDc;
93
94 /**
95 * Description de la méthode
96 * @return this.methodDc String
97 */
98 public String getMethodDc()
99 {
100 return this.methodDc;
101 }
102
103 /**
104 * Description de la méthode
105 * @param methodDcIn String
106 */
107 public void setMethodDc(String methodDcIn)
108 {
109 this.methodDc = methodDcIn;
110 }
111
112 private String methodCondition;
113
114 /**
115 * Description du conditionnement
116 * @return this.methodCondition String
117 */
118 public String getMethodCondition()
119 {
120 return this.methodCondition;
121 }
122
123 /**
124 * Description du conditionnement
125 * @param methodConditionIn String
126 */
127 public void setMethodCondition(String methodConditionIn)
128 {
129 this.methodCondition = methodConditionIn;
130 }
131
132 private String methodPrepar;
133
134 /**
135 * Description des conditions de préparation
136 * @return this.methodPrepar String
137 */
138 public String getMethodPrepar()
139 {
140 return this.methodPrepar;
141 }
142
143 /**
144 * Description des conditions de préparation
145 * @param methodPreparIn String
146 */
147 public void setMethodPrepar(String methodPreparIn)
148 {
149 this.methodPrepar = methodPreparIn;
150 }
151
152 private String methodConserv;
153
154 /**
155 * Description des conditions de conservation
156 * @return this.methodConserv String
157 */
158 public String getMethodConserv()
159 {
160 return this.methodConserv;
161 }
162
163 /**
164 * Description des conditions de conservation
165 * @param methodConservIn String
166 */
167 public void setMethodConserv(String methodConservIn)
168 {
169 this.methodConserv = methodConservIn;
170 }
171
172 private String methodRef;
173
174 /**
175 * Référence à l'origine de la méthode.
176 * Par exemple : "Bradford M., 1976. A rapid method for quantification of protein utilizing the
177 * principle of dye binding. Anal. Biochem. 72 : 248-264" ou "Circulaire 1988 Mer/Agriculture"
178 * @return this.methodRef String
179 */
180 public String getMethodRef()
181 {
182 return this.methodRef;
183 }
184
185 /**
186 * Référence à l'origine de la méthode.
187 * Par exemple : "Bradford M., 1976. A rapid method for quantification of protein utilizing the
188 * principle of dye binding. Anal. Biochem. 72 : 248-264" ou "Circulaire 1988 Mer/Agriculture"
189 * @param methodRefIn String
190 */
191 public void setMethodRef(String methodRefIn)
192 {
193 this.methodRef = methodRefIn;
194 }
195
196 private String methodRk;
197
198 /**
199 * Numéro de la méthode pour pouvoir "chainer" les méthodes
200 * @return this.methodRk String
201 */
202 public String getMethodRk()
203 {
204 return this.methodRk;
205 }
206
207 /**
208 * Numéro de la méthode pour pouvoir "chainer" les méthodes
209 * @param methodRkIn String
210 */
211 public void setMethodRk(String methodRkIn)
212 {
213 this.methodRk = methodRkIn;
214 }
215
216 private String methodHandbookPathNm;
217
218 /**
219 * Adresse du fichier de la fiche méthode
220 * @return this.methodHandbookPathNm String
221 */
222 public String getMethodHandbookPathNm()
223 {
224 return this.methodHandbookPathNm;
225 }
226
227 /**
228 * Adresse du fichier de la fiche méthode
229 * @param methodHandbookPathNmIn String
230 */
231 public void setMethodHandbookPathNm(String methodHandbookPathNmIn)
232 {
233 this.methodHandbookPathNm = methodHandbookPathNmIn;
234 }
235
236 private Date methodCreationDt;
237
238 /**
239 * Date de création
240 * @return this.methodCreationDt Date
241 */
242 public Date getMethodCreationDt()
243 {
244 return this.methodCreationDt;
245 }
246
247 /**
248 * Date de création
249 * @param methodCreationDtIn Date
250 */
251 public void setMethodCreationDt(Date methodCreationDtIn)
252 {
253 this.methodCreationDt = methodCreationDtIn;
254 }
255
256 private Timestamp updateDt;
257
258 /**
259 * Date de mise à jour
260 * @return this.updateDt Timestamp
261 */
262 public Timestamp getUpdateDt()
263 {
264 return this.updateDt;
265 }
266
267 /**
268 * Date de mise à jour
269 * @param updateDtIn Timestamp
270 */
271 public void setUpdateDt(Timestamp updateDtIn)
272 {
273 this.updateDt = updateDtIn;
274 }
275
276 // Generate 7 associations
277 private Collection<PmfmMor> pmfmMors = new HashSet<PmfmMor>();
278
279 /**
280 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
281 * @return this.pmfmMors Collection<PmfmMor>
282 */
283 public Collection<PmfmMor> getPmfmMors()
284 {
285 return this.pmfmMors;
286 }
287
288 /**
289 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
290 * @param pmfmMorsIn Collection<PmfmMor>
291 */
292 public void setPmfmMors(Collection<PmfmMor> pmfmMorsIn)
293 {
294 this.pmfmMors = pmfmMorsIn;
295 }
296
297 /**
298 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
299 * @param elementToAdd PmfmMor
300 * @return <tt>true</tt> if this collection changed as a result of the
301 * call
302 */
303 public boolean addPmfmMors(PmfmMor elementToAdd)
304 {
305 return this.pmfmMors.add(elementToAdd);
306 }
307
308 /**
309 * Quadruplets ou éléments constitutifs de quadruplets concernés par le moratoire
310 * @param elementToRemove PmfmMor
311 * @return <tt>true</tt> if this collection changed as a result of the
312 * call
313 */
314 public boolean removePmfmMors(PmfmMor elementToRemove)
315 {
316 return this.pmfmMors.remove(elementToRemove);
317 }
318
319 private Collection<SandreMethodExp> sandreMethodExpIds = new HashSet<SandreMethodExp>();
320
321 /**
322 * Méthode sandre pour les exports de données
323 * @return this.sandreMethodExpIds Collection<SandreMethodExp>
324 */
325 public Collection<SandreMethodExp> getSandreMethodExpIds()
326 {
327 return this.sandreMethodExpIds;
328 }
329
330 /**
331 * Méthode sandre pour les exports de données
332 * @param sandreMethodExpIdsIn Collection<SandreMethodExp>
333 */
334 public void setSandreMethodExpIds(Collection<SandreMethodExp> sandreMethodExpIdsIn)
335 {
336 this.sandreMethodExpIds = sandreMethodExpIdsIn;
337 }
338
339 /**
340 * Méthode sandre pour les exports de données
341 * @param elementToAdd SandreMethodExp
342 * @return <tt>true</tt> if this collection changed as a result of the
343 * call
344 */
345 public boolean addSandreMethodExpIds(SandreMethodExp elementToAdd)
346 {
347 return this.sandreMethodExpIds.add(elementToAdd);
348 }
349
350 /**
351 * Méthode sandre pour les exports de données
352 * @param elementToRemove SandreMethodExp
353 * @return <tt>true</tt> if this collection changed as a result of the
354 * call
355 */
356 public boolean removeSandreMethodExpIds(SandreMethodExp elementToRemove)
357 {
358 return this.sandreMethodExpIds.remove(elementToRemove);
359 }
360
361 private Collection<Pmfm> pmfms = new HashSet<Pmfm>();
362
363 /**
364 * Liste les quadruplets paramètre, méthode, support, fraction.
365 * @return this.pmfms Collection<Pmfm>
366 */
367 public Collection<Pmfm> getPmfms()
368 {
369 return this.pmfms;
370 }
371
372 /**
373 * Liste les quadruplets paramètre, méthode, support, fraction.
374 * @param pmfmsIn Collection<Pmfm>
375 */
376 public void setPmfms(Collection<Pmfm> pmfmsIn)
377 {
378 this.pmfms = pmfmsIn;
379 }
380
381 /**
382 * Liste les quadruplets paramètre, méthode, support, fraction.
383 * @param elementToAdd Pmfm
384 * @return <tt>true</tt> if this collection changed as a result of the
385 * call
386 */
387 public boolean addPmfms(Pmfm elementToAdd)
388 {
389 return this.pmfms.add(elementToAdd);
390 }
391
392 /**
393 * Liste les quadruplets paramètre, méthode, support, fraction.
394 * @param elementToRemove Pmfm
395 * @return <tt>true</tt> if this collection changed as a result of the
396 * call
397 */
398 public boolean removePmfms(Pmfm elementToRemove)
399 {
400 return this.pmfms.remove(elementToRemove);
401 }
402
403 private Collection<SandreMethodImp> sandreMethodImpIds = new HashSet<SandreMethodImp>();
404
405 /**
406 * Méthode sandre pour les imports de données
407 * @return this.sandreMethodImpIds Collection<SandreMethodImp>
408 */
409 public Collection<SandreMethodImp> getSandreMethodImpIds()
410 {
411 return this.sandreMethodImpIds;
412 }
413
414 /**
415 * Méthode sandre pour les imports de données
416 * @param sandreMethodImpIdsIn Collection<SandreMethodImp>
417 */
418 public void setSandreMethodImpIds(Collection<SandreMethodImp> sandreMethodImpIdsIn)
419 {
420 this.sandreMethodImpIds = sandreMethodImpIdsIn;
421 }
422
423 /**
424 * Méthode sandre pour les imports de données
425 * @param elementToAdd SandreMethodImp
426 * @return <tt>true</tt> if this collection changed as a result of the
427 * call
428 */
429 public boolean addSandreMethodImpIds(SandreMethodImp elementToAdd)
430 {
431 return this.sandreMethodImpIds.add(elementToAdd);
432 }
433
434 /**
435 * Méthode sandre pour les imports de données
436 * @param elementToRemove SandreMethodImp
437 * @return <tt>true</tt> if this collection changed as a result of the
438 * call
439 */
440 public boolean removeSandreMethodImpIds(SandreMethodImp elementToRemove)
441 {
442 return this.sandreMethodImpIds.remove(elementToRemove);
443 }
444
445 private Status status;
446
447 /**
448 * Liste des états possibles d'un objet.
449 * @return this.status Status
450 */
451 public Status getStatus()
452 {
453 return this.status;
454 }
455
456 /**
457 * Liste des états possibles d'un objet.
458 * @param statusIn Status
459 */
460 public void setStatus(Status statusIn)
461 {
462 this.status = statusIn;
463 }
464
465 /**
466 * Returns <code>true</code> if the argument is an Method instance and all identifiers for this entity
467 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
468 */
469 @Override
470 public boolean equals(Object object)
471 {
472 if (this == object)
473 {
474 return true;
475 }
476 if (!(object instanceof Method))
477 {
478 return false;
479 }
480 final Method that = (Method)object;
481 if (this.methodId == null || that.getMethodId() == null || !this.methodId.equals(that.getMethodId()))
482 {
483 return false;
484 }
485 return true;
486 }
487
488 /**
489 * Returns a hash code based on this entity's identifiers.
490 */
491 @Override
492 public int hashCode()
493 {
494 int hashCode = 0;
495 hashCode = 29 * hashCode + (this.methodId == null ? 0 : this.methodId.hashCode());
496
497 return hashCode;
498 }
499
500 /**
501 * Constructs new instances of {@link Method}.
502 */
503 public static final class Factory
504 {
505 /**
506 * Constructs a new instance of {@link Method}.
507 * @return new MethodImpl()
508 */
509 public static Method newInstance()
510 {
511 return new MethodImpl();
512 }
513
514 /**
515 * Constructs a new instance of {@link Method}, taking all required and/or
516 * read-only properties as arguments, except for identifiers.
517 * @param methodNm String
518 * @param methodRk String
519 * @param updateDt Timestamp
520 * @param status Status
521 * @return newInstance
522 */
523 public static Method newInstance(String methodNm, String methodRk, Timestamp updateDt, Status status)
524 {
525 final Method entity = new MethodImpl();
526 entity.setMethodNm(methodNm);
527 entity.setMethodRk(methodRk);
528 entity.setUpdateDt(updateDt);
529 entity.setStatus(status);
530 return entity;
531 }
532
533 /**
534 * Constructs a new instance of {@link Method}, taking all possible properties
535 * (except the identifier(s))as arguments.
536 * @param methodNm String
537 * @param methodDc String
538 * @param methodCondition String
539 * @param methodPrepar String
540 * @param methodConserv String
541 * @param methodRef String
542 * @param methodRk String
543 * @param methodHandbookPathNm String
544 * @param methodCreationDt Date
545 * @param updateDt Timestamp
546 * @param pmfmMors Collection<PmfmMor>
547 * @param sandreMethodExpIds Collection<SandreMethodExp>
548 * @param pmfms Collection<Pmfm>
549 * @param sandreMethodImpIds Collection<SandreMethodImp>
550 * @param status Status
551 * @return newInstance Method
552 */
553 public static Method newInstance(String methodNm, String methodDc, String methodCondition, String methodPrepar, String methodConserv, String methodRef, String methodRk, String methodHandbookPathNm, Date methodCreationDt, Timestamp updateDt, Collection<PmfmMor> pmfmMors, Collection<SandreMethodExp> sandreMethodExpIds, Collection<Pmfm> pmfms, Collection<SandreMethodImp> sandreMethodImpIds, Status status)
554 {
555 final Method entity = new MethodImpl();
556 entity.setMethodNm(methodNm);
557 entity.setMethodDc(methodDc);
558 entity.setMethodCondition(methodCondition);
559 entity.setMethodPrepar(methodPrepar);
560 entity.setMethodConserv(methodConserv);
561 entity.setMethodRef(methodRef);
562 entity.setMethodRk(methodRk);
563 entity.setMethodHandbookPathNm(methodHandbookPathNm);
564 entity.setMethodCreationDt(methodCreationDt);
565 entity.setUpdateDt(updateDt);
566 entity.setPmfmMors(pmfmMors);
567 entity.setSandreMethodExpIds(sandreMethodExpIds);
568 entity.setPmfms(pmfms);
569 entity.setSandreMethodImpIds(sandreMethodImpIds);
570 entity.setStatus(status);
571 return entity;
572 }
573 }
574
575 /**
576 * @see Comparable#compareTo
577 */
578 public int compareTo(Method o)
579 {
580 int cmp = 0;
581 if (this.getMethodId() != null)
582 {
583 cmp = this.getMethodId().compareTo(o.getMethodId());
584 }
585 else
586 {
587 if (this.getMethodNm() != null)
588 {
589 cmp = (cmp != 0 ? cmp : this.getMethodNm().compareTo(o.getMethodNm()));
590 }
591 if (this.getMethodDc() != null)
592 {
593 cmp = (cmp != 0 ? cmp : this.getMethodDc().compareTo(o.getMethodDc()));
594 }
595 if (this.getMethodCondition() != null)
596 {
597 cmp = (cmp != 0 ? cmp : this.getMethodCondition().compareTo(o.getMethodCondition()));
598 }
599 if (this.getMethodPrepar() != null)
600 {
601 cmp = (cmp != 0 ? cmp : this.getMethodPrepar().compareTo(o.getMethodPrepar()));
602 }
603 if (this.getMethodConserv() != null)
604 {
605 cmp = (cmp != 0 ? cmp : this.getMethodConserv().compareTo(o.getMethodConserv()));
606 }
607 if (this.getMethodRef() != null)
608 {
609 cmp = (cmp != 0 ? cmp : this.getMethodRef().compareTo(o.getMethodRef()));
610 }
611 if (this.getMethodRk() != null)
612 {
613 cmp = (cmp != 0 ? cmp : this.getMethodRk().compareTo(o.getMethodRk()));
614 }
615 if (this.getMethodHandbookPathNm() != null)
616 {
617 cmp = (cmp != 0 ? cmp : this.getMethodHandbookPathNm().compareTo(o.getMethodHandbookPathNm()));
618 }
619 if (this.getMethodCreationDt() != null)
620 {
621 cmp = (cmp != 0 ? cmp : this.getMethodCreationDt().compareTo(o.getMethodCreationDt()));
622 }
623 if (this.getUpdateDt() != null)
624 {
625 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
626 }
627 }
628 return cmp;
629 }
630 // HibernateEntity.vsl merge-point
631 // Method.java merge-point
632 }