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