1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.referential.pmfm;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
41
42
43 public abstract class Method
44 implements Serializable, Comparable<Method>
45 {
46
47
48
49 private static final long serialVersionUID = -163778324863342691L;
50
51
52 private Integer methodId;
53
54
55
56
57
58 public Integer getMethodId()
59 {
60 return this.methodId;
61 }
62
63
64
65
66
67 public void setMethodId(Integer methodIdIn)
68 {
69 this.methodId = methodIdIn;
70 }
71
72 private String methodNm;
73
74
75
76
77
78 public String getMethodNm()
79 {
80 return this.methodNm;
81 }
82
83
84
85
86
87 public void setMethodNm(String methodNmIn)
88 {
89 this.methodNm = methodNmIn;
90 }
91
92 private String methodDc;
93
94
95
96
97
98 public String getMethodDc()
99 {
100 return this.methodDc;
101 }
102
103
104
105
106
107 public void setMethodDc(String methodDcIn)
108 {
109 this.methodDc = methodDcIn;
110 }
111
112 private String methodCondition;
113
114
115
116
117
118 public String getMethodCondition()
119 {
120 return this.methodCondition;
121 }
122
123
124
125
126
127 public void setMethodCondition(String methodConditionIn)
128 {
129 this.methodCondition = methodConditionIn;
130 }
131
132 private String methodPrepar;
133
134
135
136
137
138 public String getMethodPrepar()
139 {
140 return this.methodPrepar;
141 }
142
143
144
145
146
147 public void setMethodPrepar(String methodPreparIn)
148 {
149 this.methodPrepar = methodPreparIn;
150 }
151
152 private String methodConserv;
153
154
155
156
157
158 public String getMethodConserv()
159 {
160 return this.methodConserv;
161 }
162
163
164
165
166
167 public void setMethodConserv(String methodConservIn)
168 {
169 this.methodConserv = methodConservIn;
170 }
171
172 private String methodRef;
173
174
175
176
177
178
179
180 public String getMethodRef()
181 {
182 return this.methodRef;
183 }
184
185
186
187
188
189
190
191 public void setMethodRef(String methodRefIn)
192 {
193 this.methodRef = methodRefIn;
194 }
195
196 private String methodRk;
197
198
199
200
201
202 public String getMethodRk()
203 {
204 return this.methodRk;
205 }
206
207
208
209
210
211 public void setMethodRk(String methodRkIn)
212 {
213 this.methodRk = methodRkIn;
214 }
215
216 private String methodHandbookPathNm;
217
218
219
220
221
222 public String getMethodHandbookPathNm()
223 {
224 return this.methodHandbookPathNm;
225 }
226
227
228
229
230
231 public void setMethodHandbookPathNm(String methodHandbookPathNmIn)
232 {
233 this.methodHandbookPathNm = methodHandbookPathNmIn;
234 }
235
236 private Date methodCreationDt;
237
238
239
240
241
242 public Date getMethodCreationDt()
243 {
244 return this.methodCreationDt;
245 }
246
247
248
249
250
251 public void setMethodCreationDt(Date methodCreationDtIn)
252 {
253 this.methodCreationDt = methodCreationDtIn;
254 }
255
256 private Timestamp updateDt;
257
258
259
260
261
262 public Timestamp getUpdateDt()
263 {
264 return this.updateDt;
265 }
266
267
268
269
270
271 public void setUpdateDt(Timestamp updateDtIn)
272 {
273 this.updateDt = updateDtIn;
274 }
275
276
277 private Collection<PmfmMor> pmfmMors = new HashSet<PmfmMor>();
278
279
280
281
282
283 public Collection<PmfmMor> getPmfmMors()
284 {
285 return this.pmfmMors;
286 }
287
288
289
290
291
292 public void setPmfmMors(Collection<PmfmMor> pmfmMorsIn)
293 {
294 this.pmfmMors = pmfmMorsIn;
295 }
296
297
298
299
300
301
302
303 public boolean addPmfmMors(PmfmMor elementToAdd)
304 {
305 return this.pmfmMors.add(elementToAdd);
306 }
307
308
309
310
311
312
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
323
324
325 public Collection<SandreMethodExp> getSandreMethodExpIds()
326 {
327 return this.sandreMethodExpIds;
328 }
329
330
331
332
333
334 public void setSandreMethodExpIds(Collection<SandreMethodExp> sandreMethodExpIdsIn)
335 {
336 this.sandreMethodExpIds = sandreMethodExpIdsIn;
337 }
338
339
340
341
342
343
344
345 public boolean addSandreMethodExpIds(SandreMethodExp elementToAdd)
346 {
347 return this.sandreMethodExpIds.add(elementToAdd);
348 }
349
350
351
352
353
354
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
365
366
367 public Collection<Pmfm> getPmfms()
368 {
369 return this.pmfms;
370 }
371
372
373
374
375
376 public void setPmfms(Collection<Pmfm> pmfmsIn)
377 {
378 this.pmfms = pmfmsIn;
379 }
380
381
382
383
384
385
386
387 public boolean addPmfms(Pmfm elementToAdd)
388 {
389 return this.pmfms.add(elementToAdd);
390 }
391
392
393
394
395
396
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
407
408
409 public Collection<SandreMethodImp> getSandreMethodImpIds()
410 {
411 return this.sandreMethodImpIds;
412 }
413
414
415
416
417
418 public void setSandreMethodImpIds(Collection<SandreMethodImp> sandreMethodImpIdsIn)
419 {
420 this.sandreMethodImpIds = sandreMethodImpIdsIn;
421 }
422
423
424
425
426
427
428
429 public boolean addSandreMethodImpIds(SandreMethodImp elementToAdd)
430 {
431 return this.sandreMethodImpIds.add(elementToAdd);
432 }
433
434
435
436
437
438
439
440 public boolean removeSandreMethodImpIds(SandreMethodImp elementToRemove)
441 {
442 return this.sandreMethodImpIds.remove(elementToRemove);
443 }
444
445 private Status status;
446
447
448
449
450
451 public Status getStatus()
452 {
453 return this.status;
454 }
455
456
457
458
459
460 public void setStatus(Status statusIn)
461 {
462 this.status = statusIn;
463 }
464
465
466
467
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
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
502
503 public static final class Factory
504 {
505
506
507
508
509 public static Method newInstance()
510 {
511 return new MethodImpl();
512 }
513
514
515
516
517
518
519
520
521
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
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
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
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
631
632 }