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