1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.administration.user;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 import fr.ifremer.quadrige3.core.dao.data.aquaculture.HistoricalAccount;
29 import fr.ifremer.quadrige3.core.dao.data.aquaculture.InitialPopulation;
30 import fr.ifremer.quadrige3.core.dao.referential.Privilege;
31 import fr.ifremer.quadrige3.core.dao.referential.Status;
32 import fr.ifremer.quadrige3.core.dao.system.MapProject;
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 Department
44 implements Serializable, Comparable<Department>
45 {
46
47
48
49 private static final long serialVersionUID = -7770724621159180898L;
50
51
52 private Integer depId;
53
54
55
56
57
58 public Integer getDepId()
59 {
60 return this.depId;
61 }
62
63
64
65
66
67 public void setDepId(Integer depIdIn)
68 {
69 this.depId = depIdIn;
70 }
71
72 private String depCd;
73
74
75
76
77
78
79 public String getDepCd()
80 {
81 return this.depCd;
82 }
83
84
85
86
87
88
89 public void setDepCd(String depCdIn)
90 {
91 this.depCd = depCdIn;
92 }
93
94 private String depNm;
95
96
97
98
99
100
101 public String getDepNm()
102 {
103 return this.depNm;
104 }
105
106
107
108
109
110
111 public void setDepNm(String depNmIn)
112 {
113 this.depNm = depNmIn;
114 }
115
116 private String depDc;
117
118
119
120
121
122 public String getDepDc()
123 {
124 return this.depDc;
125 }
126
127
128
129
130
131 public void setDepDc(String depDcIn)
132 {
133 this.depDc = depDcIn;
134 }
135
136 private String depEMail;
137
138
139
140
141
142 public String getDepEMail()
143 {
144 return this.depEMail;
145 }
146
147
148
149
150
151 public void setDepEMail(String depEMailIn)
152 {
153 this.depEMail = depEMailIn;
154 }
155
156 private String depAddress;
157
158
159
160
161
162 public String getDepAddress()
163 {
164 return this.depAddress;
165 }
166
167
168
169
170
171 public void setDepAddress(String depAddressIn)
172 {
173 this.depAddress = depAddressIn;
174 }
175
176 private String depPhone;
177
178
179
180
181
182 public String getDepPhone()
183 {
184 return this.depPhone;
185 }
186
187
188
189
190
191 public void setDepPhone(String depPhoneIn)
192 {
193 this.depPhone = depPhoneIn;
194 }
195
196 private String depLdapPresent;
197
198
199
200
201
202 public String getDepLdapPresent()
203 {
204 return this.depLdapPresent;
205 }
206
207
208
209
210
211 public void setDepLdapPresent(String depLdapPresentIn)
212 {
213 this.depLdapPresent = depLdapPresentIn;
214 }
215
216 private Date depCreationDt;
217
218
219
220
221
222 public Date getDepCreationDt()
223 {
224 return this.depCreationDt;
225 }
226
227
228
229
230
231 public void setDepCreationDt(Date depCreationDtIn)
232 {
233 this.depCreationDt = depCreationDtIn;
234 }
235
236 private Timestamp updateDt;
237
238
239
240
241
242 public Timestamp getUpdateDt()
243 {
244 return this.updateDt;
245 }
246
247
248
249
250
251 public void setUpdateDt(Timestamp updateDtIn)
252 {
253 this.updateDt = updateDtIn;
254 }
255
256 private String depCm;
257
258
259
260
261
262 public String getDepCm()
263 {
264 return this.depCm;
265 }
266
267
268
269
270
271 public void setDepCm(String depCmIn)
272 {
273 this.depCm = depCmIn;
274 }
275
276
277 private Collection<InitialPopulation> initialPopulations = new HashSet<InitialPopulation>();
278
279
280
281
282
283
284
285
286
287
288
289
290 public Collection<InitialPopulation> getInitialPopulations()
291 {
292 return this.initialPopulations;
293 }
294
295
296
297
298
299
300
301
302
303
304
305
306 public void setInitialPopulations(Collection<InitialPopulation> initialPopulationsIn)
307 {
308 this.initialPopulations = initialPopulationsIn;
309 }
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324 public boolean addInitialPopulations(InitialPopulation elementToAdd)
325 {
326 return this.initialPopulations.add(elementToAdd);
327 }
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342 public boolean removeInitialPopulations(InitialPopulation elementToRemove)
343 {
344 return this.initialPopulations.remove(elementToRemove);
345 }
346
347 private Status status;
348
349
350
351
352
353 public Status getStatus()
354 {
355 return this.status;
356 }
357
358
359
360
361
362 public void setStatus(Status statusIn)
363 {
364 this.status = statusIn;
365 }
366
367 private Collection<MapProject> mapProjectIds = new HashSet<MapProject>();
368
369
370
371
372
373 public Collection<MapProject> getMapProjectIds()
374 {
375 return this.mapProjectIds;
376 }
377
378
379
380
381
382 public void setMapProjectIds(Collection<MapProject> mapProjectIdsIn)
383 {
384 this.mapProjectIds = mapProjectIdsIn;
385 }
386
387
388
389
390
391
392
393 public boolean addMapProjectIds(MapProject elementToAdd)
394 {
395 return this.mapProjectIds.add(elementToAdd);
396 }
397
398
399
400
401
402
403
404 public boolean removeMapProjectIds(MapProject elementToRemove)
405 {
406 return this.mapProjectIds.remove(elementToRemove);
407 }
408
409 private Collection<HistoricalAccount> historicalAccounts = new HashSet<HistoricalAccount>();
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424 public Collection<HistoricalAccount> getHistoricalAccounts()
425 {
426 return this.historicalAccounts;
427 }
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442 public void setHistoricalAccounts(Collection<HistoricalAccount> historicalAccountsIn)
443 {
444 this.historicalAccounts = historicalAccountsIn;
445 }
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462 public boolean addHistoricalAccounts(HistoricalAccount elementToAdd)
463 {
464 return this.historicalAccounts.add(elementToAdd);
465 }
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482 public boolean removeHistoricalAccounts(HistoricalAccount elementToRemove)
483 {
484 return this.historicalAccounts.remove(elementToRemove);
485 }
486
487 private Collection<PrivilegeTransfer> privilegeTransfers = new HashSet<PrivilegeTransfer>();
488
489
490
491
492
493 public Collection<PrivilegeTransfer> getPrivilegeTransfers()
494 {
495 return this.privilegeTransfers;
496 }
497
498
499
500
501
502 public void setPrivilegeTransfers(Collection<PrivilegeTransfer> privilegeTransfersIn)
503 {
504 this.privilegeTransfers = privilegeTransfersIn;
505 }
506
507
508
509
510
511
512
513 public boolean addPrivilegeTransfers(PrivilegeTransfer elementToAdd)
514 {
515 return this.privilegeTransfers.add(elementToAdd);
516 }
517
518
519
520
521
522
523
524 public boolean removePrivilegeTransfers(PrivilegeTransfer elementToRemove)
525 {
526 return this.privilegeTransfers.remove(elementToRemove);
527 }
528
529 private Collection<Department> departments = new HashSet<Department>();
530
531
532
533
534
535 public Collection<Department> getDepartments()
536 {
537 return this.departments;
538 }
539
540
541
542
543
544 public void setDepartments(Collection<Department> departmentsIn)
545 {
546 this.departments = departmentsIn;
547 }
548
549
550
551
552
553
554
555 public boolean addDepartments(Department elementToAdd)
556 {
557 return this.departments.add(elementToAdd);
558 }
559
560
561
562
563
564
565
566 public boolean removeDepartments(Department elementToRemove)
567 {
568 return this.departments.remove(elementToRemove);
569 }
570
571 private Department parentDepartment;
572
573
574
575
576
577 public Department getParentDepartment()
578 {
579 return this.parentDepartment;
580 }
581
582
583
584
585
586 public void setParentDepartment(Department parentDepartmentIn)
587 {
588 this.parentDepartment = parentDepartmentIn;
589 }
590
591 private Collection<Privilege> privileges = new HashSet<Privilege>();
592
593
594
595
596
597 public Collection<Privilege> getPrivileges()
598 {
599 return this.privileges;
600 }
601
602
603
604
605
606 public void setPrivileges(Collection<Privilege> privilegesIn)
607 {
608 this.privileges = privilegesIn;
609 }
610
611
612
613
614
615
616
617 public boolean addPrivileges(Privilege elementToAdd)
618 {
619 return this.privileges.add(elementToAdd);
620 }
621
622
623
624
625
626
627
628 public boolean removePrivileges(Privilege elementToRemove)
629 {
630 return this.privileges.remove(elementToRemove);
631 }
632
633 private Collection<Quser> qusers = new HashSet<Quser>();
634
635
636
637
638
639 public Collection<Quser> getQusers()
640 {
641 return this.qusers;
642 }
643
644
645
646
647
648 public void setQusers(Collection<Quser> qusersIn)
649 {
650 this.qusers = qusersIn;
651 }
652
653
654
655
656
657
658
659 public boolean addQusers(Quser elementToAdd)
660 {
661 return this.qusers.add(elementToAdd);
662 }
663
664
665
666
667
668
669
670 public boolean removeQusers(Quser elementToRemove)
671 {
672 return this.qusers.remove(elementToRemove);
673 }
674
675
676
677
678
679 @Override
680 public boolean equals(Object object)
681 {
682 if (this == object)
683 {
684 return true;
685 }
686 if (!(object instanceof Department))
687 {
688 return false;
689 }
690 final Department that = (Department)object;
691 if (this.depId == null || that.getDepId() == null || !this.depId.equals(that.getDepId()))
692 {
693 return false;
694 }
695 return true;
696 }
697
698
699
700
701 @Override
702 public int hashCode()
703 {
704 int hashCode = 0;
705 hashCode = 29 * hashCode + (this.depId == null ? 0 : this.depId.hashCode());
706
707 return hashCode;
708 }
709
710
711
712
713 public static final class Factory
714 {
715
716
717
718
719 public static Department newInstance()
720 {
721 return new DepartmentImpl();
722 }
723
724
725
726
727
728
729
730
731
732 public static Department newInstance(String depCd, String depNm, Status status)
733 {
734 final Department entity = new DepartmentImpl();
735 entity.setDepCd(depCd);
736 entity.setDepNm(depNm);
737 entity.setStatus(status);
738 return entity;
739 }
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765 public static Department newInstance(String depCd, String depNm, String depDc, String depEMail, String depAddress, String depPhone, String depLdapPresent, Date depCreationDt, Timestamp updateDt, String depCm, Collection<InitialPopulation> initialPopulations, Status status, Collection<MapProject> mapProjectIds, Collection<HistoricalAccount> historicalAccounts, Collection<PrivilegeTransfer> privilegeTransfers, Collection<Department> departments, Department parentDepartment, Collection<Privilege> privileges, Collection<Quser> qusers)
766 {
767 final Department entity = new DepartmentImpl();
768 entity.setDepCd(depCd);
769 entity.setDepNm(depNm);
770 entity.setDepDc(depDc);
771 entity.setDepEMail(depEMail);
772 entity.setDepAddress(depAddress);
773 entity.setDepPhone(depPhone);
774 entity.setDepLdapPresent(depLdapPresent);
775 entity.setDepCreationDt(depCreationDt);
776 entity.setUpdateDt(updateDt);
777 entity.setDepCm(depCm);
778 entity.setInitialPopulations(initialPopulations);
779 entity.setStatus(status);
780 entity.setMapProjectIds(mapProjectIds);
781 entity.setHistoricalAccounts(historicalAccounts);
782 entity.setPrivilegeTransfers(privilegeTransfers);
783 entity.setDepartments(departments);
784 entity.setParentDepartment(parentDepartment);
785 entity.setPrivileges(privileges);
786 entity.setQusers(qusers);
787 return entity;
788 }
789 }
790
791
792
793
794 public int compareTo(Department o)
795 {
796 int cmp = 0;
797 if (this.getDepId() != null)
798 {
799 cmp = this.getDepId().compareTo(o.getDepId());
800 }
801 else
802 {
803 if (this.getDepCd() != null)
804 {
805 cmp = (cmp != 0 ? cmp : this.getDepCd().compareTo(o.getDepCd()));
806 }
807 if (this.getDepNm() != null)
808 {
809 cmp = (cmp != 0 ? cmp : this.getDepNm().compareTo(o.getDepNm()));
810 }
811 if (this.getDepDc() != null)
812 {
813 cmp = (cmp != 0 ? cmp : this.getDepDc().compareTo(o.getDepDc()));
814 }
815 if (this.getDepEMail() != null)
816 {
817 cmp = (cmp != 0 ? cmp : this.getDepEMail().compareTo(o.getDepEMail()));
818 }
819 if (this.getDepAddress() != null)
820 {
821 cmp = (cmp != 0 ? cmp : this.getDepAddress().compareTo(o.getDepAddress()));
822 }
823 if (this.getDepPhone() != null)
824 {
825 cmp = (cmp != 0 ? cmp : this.getDepPhone().compareTo(o.getDepPhone()));
826 }
827 if (this.getDepLdapPresent() != null)
828 {
829 cmp = (cmp != 0 ? cmp : this.getDepLdapPresent().compareTo(o.getDepLdapPresent()));
830 }
831 if (this.getDepCreationDt() != null)
832 {
833 cmp = (cmp != 0 ? cmp : this.getDepCreationDt().compareTo(o.getDepCreationDt()));
834 }
835 if (this.getUpdateDt() != null)
836 {
837 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
838 }
839 if (this.getDepCm() != null)
840 {
841 cmp = (cmp != 0 ? cmp : this.getDepCm().compareTo(o.getDepCm()));
842 }
843 }
844 return cmp;
845 }
846
847
848 }