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.SandreFractionExp;
32 import fr.ifremer.quadrige2.core.dao.sandre.SandreFractionImp;
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 Fraction
44 implements Serializable, Comparable<Fraction>
45 {
46
47
48
49 private static final long serialVersionUID = -7816806677988726532L;
50
51
52 private Integer fractionId;
53
54
55
56
57
58 public Integer getFractionId()
59 {
60 return this.fractionId;
61 }
62
63
64
65
66
67 public void setFractionId(Integer fractionIdIn)
68 {
69 this.fractionId = fractionIdIn;
70 }
71
72 private String fractionNm;
73
74
75
76
77
78 public String getFractionNm()
79 {
80 return this.fractionNm;
81 }
82
83
84
85
86
87 public void setFractionNm(String fractionNmIn)
88 {
89 this.fractionNm = fractionNmIn;
90 }
91
92 private String fractionDc;
93
94
95
96
97
98 public String getFractionDc()
99 {
100 return this.fractionDc;
101 }
102
103
104
105
106
107 public void setFractionDc(String fractionDcIn)
108 {
109 this.fractionDc = fractionDcIn;
110 }
111
112 private Date fractionCreationDt;
113
114
115
116
117
118 public Date getFractionCreationDt()
119 {
120 return this.fractionCreationDt;
121 }
122
123
124
125
126
127 public void setFractionCreationDt(Date fractionCreationDtIn)
128 {
129 this.fractionCreationDt = fractionCreationDtIn;
130 }
131
132 private Timestamp updateDt;
133
134
135
136
137
138 public Timestamp getUpdateDt()
139 {
140 return this.updateDt;
141 }
142
143
144
145
146
147 public void setUpdateDt(Timestamp updateDtIn)
148 {
149 this.updateDt = updateDtIn;
150 }
151
152
153 private Collection<SandreFractionExp> sandreFractionExpIds = new HashSet<SandreFractionExp>();
154
155
156
157
158
159 public Collection<SandreFractionExp> getSandreFractionExpIds()
160 {
161 return this.sandreFractionExpIds;
162 }
163
164
165
166
167
168 public void setSandreFractionExpIds(Collection<SandreFractionExp> sandreFractionExpIdsIn)
169 {
170 this.sandreFractionExpIds = sandreFractionExpIdsIn;
171 }
172
173
174
175
176
177
178
179 public boolean addSandreFractionExpIds(SandreFractionExp elementToAdd)
180 {
181 return this.sandreFractionExpIds.add(elementToAdd);
182 }
183
184
185
186
187
188
189
190 public boolean removeSandreFractionExpIds(SandreFractionExp elementToRemove)
191 {
192 return this.sandreFractionExpIds.remove(elementToRemove);
193 }
194
195 private Collection<PmfmMor> pmfmMors = new HashSet<PmfmMor>();
196
197
198
199
200
201 public Collection<PmfmMor> getPmfmMors()
202 {
203 return this.pmfmMors;
204 }
205
206
207
208
209
210 public void setPmfmMors(Collection<PmfmMor> pmfmMorsIn)
211 {
212 this.pmfmMors = pmfmMorsIn;
213 }
214
215
216
217
218
219
220
221 public boolean addPmfmMors(PmfmMor elementToAdd)
222 {
223 return this.pmfmMors.add(elementToAdd);
224 }
225
226
227
228
229
230
231
232 public boolean removePmfmMors(PmfmMor elementToRemove)
233 {
234 return this.pmfmMors.remove(elementToRemove);
235 }
236
237 private Collection<Matrix> matrixes = new HashSet<Matrix>();
238
239
240
241
242
243 public Collection<Matrix> getMatrixes()
244 {
245 return this.matrixes;
246 }
247
248
249
250
251
252 public void setMatrixes(Collection<Matrix> matrixesIn)
253 {
254 this.matrixes = matrixesIn;
255 }
256
257
258
259
260
261
262
263 public boolean addMatrixes(Matrix elementToAdd)
264 {
265 return this.matrixes.add(elementToAdd);
266 }
267
268
269
270
271
272
273
274 public boolean removeMatrixes(Matrix elementToRemove)
275 {
276 return this.matrixes.remove(elementToRemove);
277 }
278
279 private Collection<SandreFractionImp> sandreFractionImpIds = new HashSet<SandreFractionImp>();
280
281
282
283
284
285 public Collection<SandreFractionImp> getSandreFractionImpIds()
286 {
287 return this.sandreFractionImpIds;
288 }
289
290
291
292
293
294 public void setSandreFractionImpIds(Collection<SandreFractionImp> sandreFractionImpIdsIn)
295 {
296 this.sandreFractionImpIds = sandreFractionImpIdsIn;
297 }
298
299
300
301
302
303
304
305 public boolean addSandreFractionImpIds(SandreFractionImp elementToAdd)
306 {
307 return this.sandreFractionImpIds.add(elementToAdd);
308 }
309
310
311
312
313
314
315
316 public boolean removeSandreFractionImpIds(SandreFractionImp elementToRemove)
317 {
318 return this.sandreFractionImpIds.remove(elementToRemove);
319 }
320
321 private Collection<Pmfm> pmfms = new HashSet<Pmfm>();
322
323
324
325
326
327 public Collection<Pmfm> getPmfms()
328 {
329 return this.pmfms;
330 }
331
332
333
334
335
336 public void setPmfms(Collection<Pmfm> pmfmsIn)
337 {
338 this.pmfms = pmfmsIn;
339 }
340
341
342
343
344
345
346
347 public boolean addPmfms(Pmfm elementToAdd)
348 {
349 return this.pmfms.add(elementToAdd);
350 }
351
352
353
354
355
356
357
358 public boolean removePmfms(Pmfm elementToRemove)
359 {
360 return this.pmfms.remove(elementToRemove);
361 }
362
363 private Status status;
364
365
366
367
368
369 public Status getStatus()
370 {
371 return this.status;
372 }
373
374
375
376
377
378 public void setStatus(Status statusIn)
379 {
380 this.status = statusIn;
381 }
382
383
384
385
386
387 @Override
388 public boolean equals(Object object)
389 {
390 if (this == object)
391 {
392 return true;
393 }
394 if (!(object instanceof Fraction))
395 {
396 return false;
397 }
398 final Fraction that = (Fraction)object;
399 if (this.fractionId == null || that.getFractionId() == null || !this.fractionId.equals(that.getFractionId()))
400 {
401 return false;
402 }
403 return true;
404 }
405
406
407
408
409 @Override
410 public int hashCode()
411 {
412 int hashCode = 0;
413 hashCode = 29 * hashCode + (this.fractionId == null ? 0 : this.fractionId.hashCode());
414
415 return hashCode;
416 }
417
418
419
420
421 public static final class Factory
422 {
423
424
425
426
427 public static Fraction newInstance()
428 {
429 return new FractionImpl();
430 }
431
432
433
434
435
436
437
438
439
440 public static Fraction newInstance(String fractionNm, Timestamp updateDt, Status status)
441 {
442 final Fraction entity = new FractionImpl();
443 entity.setFractionNm(fractionNm);
444 entity.setUpdateDt(updateDt);
445 entity.setStatus(status);
446 return entity;
447 }
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464 public static Fraction newInstance(String fractionNm, String fractionDc, Date fractionCreationDt, Timestamp updateDt, Collection<SandreFractionExp> sandreFractionExpIds, Collection<PmfmMor> pmfmMors, Collection<Matrix> matrixes, Collection<SandreFractionImp> sandreFractionImpIds, Collection<Pmfm> pmfms, Status status)
465 {
466 final Fraction entity = new FractionImpl();
467 entity.setFractionNm(fractionNm);
468 entity.setFractionDc(fractionDc);
469 entity.setFractionCreationDt(fractionCreationDt);
470 entity.setUpdateDt(updateDt);
471 entity.setSandreFractionExpIds(sandreFractionExpIds);
472 entity.setPmfmMors(pmfmMors);
473 entity.setMatrixes(matrixes);
474 entity.setSandreFractionImpIds(sandreFractionImpIds);
475 entity.setPmfms(pmfms);
476 entity.setStatus(status);
477 return entity;
478 }
479 }
480
481
482
483
484 public int compareTo(Fraction o)
485 {
486 int cmp = 0;
487 if (this.getFractionId() != null)
488 {
489 cmp = this.getFractionId().compareTo(o.getFractionId());
490 }
491 else
492 {
493 if (this.getFractionNm() != null)
494 {
495 cmp = (cmp != 0 ? cmp : this.getFractionNm().compareTo(o.getFractionNm()));
496 }
497 if (this.getFractionDc() != null)
498 {
499 cmp = (cmp != 0 ? cmp : this.getFractionDc().compareTo(o.getFractionDc()));
500 }
501 if (this.getFractionCreationDt() != null)
502 {
503 cmp = (cmp != 0 ? cmp : this.getFractionCreationDt().compareTo(o.getFractionCreationDt()));
504 }
505 if (this.getUpdateDt() != null)
506 {
507 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
508 }
509 }
510 return cmp;
511 }
512
513
514 }