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.administration.user;
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.Privilege;
29 import fr.ifremer.quadrige3.core.dao.referential.Status;
30 import fr.ifremer.quadrige3.core.dao.system.Job;
31 import fr.ifremer.quadrige3.core.dao.system.MapProject;
32 import fr.ifremer.quadrige3.core.dao.system.Selection;
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 * Liste l'ensemble des agents et utilisateurs du système.
41 */
42 // HibernateEntity.vsl annotations merge-point
43 public abstract class Quser
44 implements Serializable, Comparable<Quser>
45 {
46 /**
47 * The serial version UID of this class. Needed for serialization.
48 */
49 private static final long serialVersionUID = -7230460421992938572L;
50
51 // Generate 17 attributes
52 private Integer quserId;
53
54 /**
55 * Identifiant interne d'un agent
56 * @return this.quserId Integer
57 */
58 public Integer getQuserId()
59 {
60 return this.quserId;
61 }
62
63 /**
64 * Identifiant interne d'un agent
65 * @param quserIdIn Integer
66 */
67 public void setQuserId(Integer quserIdIn)
68 {
69 this.quserId = quserIdIn;
70 }
71
72 private String quserCd;
73
74 /**
75 * Matricule : identifie de manière unique une personne dans LDAP, attribut obligatoire dans
76 * LDAP
77 * @return this.quserCd String
78 */
79 public String getQuserCd()
80 {
81 return this.quserCd;
82 }
83
84 /**
85 * Matricule : identifie de manière unique une personne dans LDAP, attribut obligatoire dans
86 * LDAP
87 * @param quserCdIn String
88 */
89 public void setQuserCd(String quserCdIn)
90 {
91 this.quserCd = quserCdIn;
92 }
93
94 private String quserLastNm;
95
96 /**
97 * Nom de l'agent, obligatoire
98 * @return this.quserLastNm String
99 */
100 public String getQuserLastNm()
101 {
102 return this.quserLastNm;
103 }
104
105 /**
106 * Nom de l'agent, obligatoire
107 * @param quserLastNmIn String
108 */
109 public void setQuserLastNm(String quserLastNmIn)
110 {
111 this.quserLastNm = quserLastNmIn;
112 }
113
114 private String quserFirstNm;
115
116 /**
117 * Prénom de l'agent
118 * @return this.quserFirstNm String
119 */
120 public String getQuserFirstNm()
121 {
122 return this.quserFirstNm;
123 }
124
125 /**
126 * Prénom de l'agent
127 * @param quserFirstNmIn String
128 */
129 public void setQuserFirstNm(String quserFirstNmIn)
130 {
131 this.quserFirstNm = quserFirstNmIn;
132 }
133
134 private String quserIntranetLg;
135
136 /**
137 * UID du LDAP intranet de l'agent s'il existe
138 * @return this.quserIntranetLg String
139 */
140 public String getQuserIntranetLg()
141 {
142 return this.quserIntranetLg;
143 }
144
145 /**
146 * UID du LDAP intranet de l'agent s'il existe
147 * @param quserIntranetLgIn String
148 */
149 public void setQuserIntranetLg(String quserIntranetLgIn)
150 {
151 this.quserIntranetLg = quserIntranetLgIn;
152 }
153
154 private String quserExtranetLg;
155
156 /**
157 * UID du LDAP extranet de l'agent s'il existe
158 * @return this.quserExtranetLg String
159 */
160 public String getQuserExtranetLg()
161 {
162 return this.quserExtranetLg;
163 }
164
165 /**
166 * UID du LDAP extranet de l'agent s'il existe
167 * @param quserExtranetLgIn String
168 */
169 public void setQuserExtranetLg(String quserExtranetLgIn)
170 {
171 this.quserExtranetLg = quserExtranetLgIn;
172 }
173
174 private String quserEMail;
175
176 /**
177 * Adresse électronique de la personne
178 * @return this.quserEMail String
179 */
180 public String getQuserEMail()
181 {
182 return this.quserEMail;
183 }
184
185 /**
186 * Adresse électronique de la personne
187 * @param quserEMailIn String
188 */
189 public void setQuserEMail(String quserEMailIn)
190 {
191 this.quserEMail = quserEMailIn;
192 }
193
194 private String quserAddress;
195
196 /**
197 * Adresse du site dans le LDAP, ou informations sur l'adresse de l'utilisateur.
198 * @return this.quserAddress String
199 */
200 public String getQuserAddress()
201 {
202 return this.quserAddress;
203 }
204
205 /**
206 * Adresse du site dans le LDAP, ou informations sur l'adresse de l'utilisateur.
207 * @param quserAddressIn String
208 */
209 public void setQuserAddress(String quserAddressIn)
210 {
211 this.quserAddress = quserAddressIn;
212 }
213
214 private String quserPhone;
215
216 /**
217 * Liste des téléphones de la personnes
218 * @return this.quserPhone String
219 */
220 public String getQuserPhone()
221 {
222 return this.quserPhone;
223 }
224
225 /**
226 * Liste des téléphones de la personnes
227 * @param quserPhoneIn String
228 */
229 public void setQuserPhone(String quserPhoneIn)
230 {
231 this.quserPhone = quserPhoneIn;
232 }
233
234 private String quserOrgan;
235
236 /**
237 * Organisme dont dépend la personne (voir avec service)!!!
238 * @return this.quserOrgan String
239 */
240 public String getQuserOrgan()
241 {
242 return this.quserOrgan;
243 }
244
245 /**
246 * Organisme dont dépend la personne (voir avec service)!!!
247 * @param quserOrganIn String
248 */
249 public void setQuserOrgan(String quserOrganIn)
250 {
251 this.quserOrgan = quserOrganIn;
252 }
253
254 private String quserAdminCenter;
255
256 /**
257 * Centre administratif dont dépend la personne (voir avec service) !!
258 * @return this.quserAdminCenter String
259 */
260 public String getQuserAdminCenter()
261 {
262 return this.quserAdminCenter;
263 }
264
265 /**
266 * Centre administratif dont dépend la personne (voir avec service) !!
267 * @param quserAdminCenterIn String
268 */
269 public void setQuserAdminCenter(String quserAdminCenterIn)
270 {
271 this.quserAdminCenter = quserAdminCenterIn;
272 }
273
274 private String quserSite;
275
276 /**
277 * Site auquel est affectée la personne
278 * @return this.quserSite String
279 */
280 public String getQuserSite()
281 {
282 return this.quserSite;
283 }
284
285 /**
286 * Site auquel est affectée la personne
287 * @param quserSiteIn String
288 */
289 public void setQuserSite(String quserSiteIn)
290 {
291 this.quserSite = quserSiteIn;
292 }
293
294 private String quserLdapPresent;
295
296 /**
297 * Oui, si l'utilisateur est présent dans le LDAP (code renseigné).
298 * @return this.quserLdapPresent String
299 */
300 public String getQuserLdapPresent()
301 {
302 return this.quserLdapPresent;
303 }
304
305 /**
306 * Oui, si l'utilisateur est présent dans le LDAP (code renseigné).
307 * @param quserLdapPresentIn String
308 */
309 public void setQuserLdapPresent(String quserLdapPresentIn)
310 {
311 this.quserLdapPresent = quserLdapPresentIn;
312 }
313
314 private String quserCryptPassword;
315
316 /**
317 * Crypt password, for local DB only (e.g. ReefDb)
318 * @return this.quserCryptPassword String
319 */
320 public String getQuserCryptPassword()
321 {
322 return this.quserCryptPassword;
323 }
324
325 /**
326 * Crypt password, for local DB only (e.g. ReefDb)
327 * @param quserCryptPasswordIn String
328 */
329 public void setQuserCryptPassword(String quserCryptPasswordIn)
330 {
331 this.quserCryptPassword = quserCryptPasswordIn;
332 }
333
334 private Date quserCreationDt;
335
336 /**
337 * Date de création de l'objet
338 * @return this.quserCreationDt Date
339 */
340 public Date getQuserCreationDt()
341 {
342 return this.quserCreationDt;
343 }
344
345 /**
346 * Date de création de l'objet
347 * @param quserCreationDtIn Date
348 */
349 public void setQuserCreationDt(Date quserCreationDtIn)
350 {
351 this.quserCreationDt = quserCreationDtIn;
352 }
353
354 private Timestamp updateDt;
355
356 /**
357 * Date de modification de l'objet
358 * @return this.updateDt Timestamp
359 */
360 public Timestamp getUpdateDt()
361 {
362 return this.updateDt;
363 }
364
365 /**
366 * Date de modification de l'objet
367 * @param updateDtIn Timestamp
368 */
369 public void setUpdateDt(Timestamp updateDtIn)
370 {
371 this.updateDt = updateDtIn;
372 }
373
374 private String quserCm;
375
376 /**
377 *
378 * @return this.quserCm String
379 */
380 public String getQuserCm()
381 {
382 return this.quserCm;
383 }
384
385 /**
386 *
387 * @param quserCmIn String
388 */
389 public void setQuserCm(String quserCmIn)
390 {
391 this.quserCm = quserCmIn;
392 }
393
394 // Generate 21 associations
395 private Collection<Privilege> privileges = new HashSet<Privilege>();
396
397 /**
398 * Ensemble des privilèges utilisateurs.
399 * @return this.privileges Collection<Privilege>
400 */
401 public Collection<Privilege> getPrivileges()
402 {
403 return this.privileges;
404 }
405
406 /**
407 * Ensemble des privilèges utilisateurs.
408 * @param privilegesIn Collection<Privilege>
409 */
410 public void setPrivileges(Collection<Privilege> privilegesIn)
411 {
412 this.privileges = privilegesIn;
413 }
414
415 /**
416 * Ensemble des privilèges utilisateurs.
417 * @param elementToAdd Privilege
418 * @return <tt>true</tt> if this collection changed as a result of the
419 * call
420 */
421 public boolean addPrivileges(Privilege elementToAdd)
422 {
423 return this.privileges.add(elementToAdd);
424 }
425
426 /**
427 * Ensemble des privilèges utilisateurs.
428 * @param elementToRemove Privilege
429 * @return <tt>true</tt> if this collection changed as a result of the
430 * call
431 */
432 public boolean removePrivileges(Privilege elementToRemove)
433 {
434 return this.privileges.remove(elementToRemove);
435 }
436
437 private Collection<Job> jobIds = new HashSet<Job>();
438
439 /**
440 * Liste des taches de fond lancées
441 * @return this.jobIds Collection<Job>
442 */
443 public Collection<Job> getJobIds()
444 {
445 return this.jobIds;
446 }
447
448 /**
449 * Liste des taches de fond lancées
450 * @param jobIdsIn Collection<Job>
451 */
452 public void setJobIds(Collection<Job> jobIdsIn)
453 {
454 this.jobIds = jobIdsIn;
455 }
456
457 /**
458 * Liste des taches de fond lancées
459 * @param elementToAdd Job
460 * @return <tt>true</tt> if this collection changed as a result of the
461 * call
462 */
463 public boolean addJobIds(Job elementToAdd)
464 {
465 return this.jobIds.add(elementToAdd);
466 }
467
468 /**
469 * Liste des taches de fond lancées
470 * @param elementToRemove Job
471 * @return <tt>true</tt> if this collection changed as a result of the
472 * call
473 */
474 public boolean removeJobIds(Job elementToRemove)
475 {
476 return this.jobIds.remove(elementToRemove);
477 }
478
479 private Status status;
480
481 /**
482 * Liste des états possibles d'un objet.
483 * @return this.status Status
484 */
485 public Status getStatus()
486 {
487 return this.status;
488 }
489
490 /**
491 * Liste des états possibles d'un objet.
492 * @param statusIn Status
493 */
494 public void setStatus(Status statusIn)
495 {
496 this.status = statusIn;
497 }
498
499 private Collection<Selection> selIds = new HashSet<Selection>();
500
501 /**
502 * Liste des sélections cartographique.
503 * @return this.selIds Collection<Selection>
504 */
505 public Collection<Selection> getSelIds()
506 {
507 return this.selIds;
508 }
509
510 /**
511 * Liste des sélections cartographique.
512 * @param selIdsIn Collection<Selection>
513 */
514 public void setSelIds(Collection<Selection> selIdsIn)
515 {
516 this.selIds = selIdsIn;
517 }
518
519 /**
520 * Liste des sélections cartographique.
521 * @param elementToAdd Selection
522 * @return <tt>true</tt> if this collection changed as a result of the
523 * call
524 */
525 public boolean addSelIds(Selection elementToAdd)
526 {
527 return this.selIds.add(elementToAdd);
528 }
529
530 /**
531 * Liste des sélections cartographique.
532 * @param elementToRemove Selection
533 * @return <tt>true</tt> if this collection changed as a result of the
534 * call
535 */
536 public boolean removeSelIds(Selection elementToRemove)
537 {
538 return this.selIds.remove(elementToRemove);
539 }
540
541 private Department department;
542
543 /**
544 * Liste les départements ou services auxquels sont rattachés les agents
545 * @return this.department Department
546 */
547 public Department getDepartment()
548 {
549 return this.department;
550 }
551
552 /**
553 * Liste les départements ou services auxquels sont rattachés les agents
554 * @param departmentIn Department
555 */
556 public void setDepartment(Department departmentIn)
557 {
558 this.department = departmentIn;
559 }
560
561 private Collection<MapProject> mapProjectIds = new HashSet<MapProject>();
562
563 /**
564 * Projet cartographique
565 * @return this.mapProjectIds Collection<MapProject>
566 */
567 public Collection<MapProject> getMapProjectIds()
568 {
569 return this.mapProjectIds;
570 }
571
572 /**
573 * Projet cartographique
574 * @param mapProjectIdsIn Collection<MapProject>
575 */
576 public void setMapProjectIds(Collection<MapProject> mapProjectIdsIn)
577 {
578 this.mapProjectIds = mapProjectIdsIn;
579 }
580
581 /**
582 * Projet cartographique
583 * @param elementToAdd MapProject
584 * @return <tt>true</tt> if this collection changed as a result of the
585 * call
586 */
587 public boolean addMapProjectIds(MapProject elementToAdd)
588 {
589 return this.mapProjectIds.add(elementToAdd);
590 }
591
592 /**
593 * Projet cartographique
594 * @param elementToRemove MapProject
595 * @return <tt>true</tt> if this collection changed as a result of the
596 * call
597 */
598 public boolean removeMapProjectIds(MapProject elementToRemove)
599 {
600 return this.mapProjectIds.remove(elementToRemove);
601 }
602
603 /**
604 * Returns <code>true</code> if the argument is an Quser instance and all identifiers for this entity
605 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
606 */
607 @Override
608 public boolean equals(Object object)
609 {
610 if (this == object)
611 {
612 return true;
613 }
614 if (!(object instanceof Quser))
615 {
616 return false;
617 }
618 final Quser that = (Quser)object;
619 if (this.quserId == null || that.getQuserId() == null || !this.quserId.equals(that.getQuserId()))
620 {
621 return false;
622 }
623 return true;
624 }
625
626 /**
627 * Returns a hash code based on this entity's identifiers.
628 */
629 @Override
630 public int hashCode()
631 {
632 int hashCode = 0;
633 hashCode = 29 * hashCode + (this.quserId == null ? 0 : this.quserId.hashCode());
634
635 return hashCode;
636 }
637
638 /**
639 * Constructs new instances of {@link Quser}.
640 */
641 public static final class Factory
642 {
643 /**
644 * Constructs a new instance of {@link Quser}.
645 * @return new QuserImpl()
646 */
647 public static Quser newInstance()
648 {
649 return new QuserImpl();
650 }
651
652 /**
653 * Constructs a new instance of {@link Quser}, taking all required and/or
654 * read-only properties as arguments, except for identifiers.
655 * @param quserLastNm String
656 * @param quserFirstNm String
657 * @param status Status
658 * @param department Department
659 * @return newInstance
660 */
661 public static Quser newInstance(String quserLastNm, String quserFirstNm, Status status, Department department)
662 {
663 final Quser entity = new QuserImpl();
664 entity.setQuserLastNm(quserLastNm);
665 entity.setQuserFirstNm(quserFirstNm);
666 entity.setStatus(status);
667 entity.setDepartment(department);
668 return entity;
669 }
670
671 /**
672 * Constructs a new instance of {@link Quser}, taking all possible properties
673 * (except the identifier(s))as arguments.
674 * @param quserCd String
675 * @param quserLastNm String
676 * @param quserFirstNm String
677 * @param quserIntranetLg String
678 * @param quserExtranetLg String
679 * @param quserEMail String
680 * @param quserAddress String
681 * @param quserPhone String
682 * @param quserOrgan String
683 * @param quserAdminCenter String
684 * @param quserSite String
685 * @param quserLdapPresent String
686 * @param quserCryptPassword String
687 * @param quserCreationDt Date
688 * @param updateDt Timestamp
689 * @param quserCm String
690 * @param privileges Collection<Privilege>
691 * @param jobIds Collection<Job>
692 * @param status Status
693 * @param selIds Collection<Selection>
694 * @param department Department
695 * @param mapProjectIds Collection<MapProject>
696 * @return newInstance Quser
697 */
698 public static Quser newInstance(String quserCd, String quserLastNm, String quserFirstNm, String quserIntranetLg, String quserExtranetLg, String quserEMail, String quserAddress, String quserPhone, String quserOrgan, String quserAdminCenter, String quserSite, String quserLdapPresent, String quserCryptPassword, Date quserCreationDt, Timestamp updateDt, String quserCm, Collection<Privilege> privileges, Collection<Job> jobIds, Status status, Collection<Selection> selIds, Department department, Collection<MapProject> mapProjectIds)
699 {
700 final Quser entity = new QuserImpl();
701 entity.setQuserCd(quserCd);
702 entity.setQuserLastNm(quserLastNm);
703 entity.setQuserFirstNm(quserFirstNm);
704 entity.setQuserIntranetLg(quserIntranetLg);
705 entity.setQuserExtranetLg(quserExtranetLg);
706 entity.setQuserEMail(quserEMail);
707 entity.setQuserAddress(quserAddress);
708 entity.setQuserPhone(quserPhone);
709 entity.setQuserOrgan(quserOrgan);
710 entity.setQuserAdminCenter(quserAdminCenter);
711 entity.setQuserSite(quserSite);
712 entity.setQuserLdapPresent(quserLdapPresent);
713 entity.setQuserCryptPassword(quserCryptPassword);
714 entity.setQuserCreationDt(quserCreationDt);
715 entity.setUpdateDt(updateDt);
716 entity.setQuserCm(quserCm);
717 entity.setPrivileges(privileges);
718 entity.setJobIds(jobIds);
719 entity.setStatus(status);
720 entity.setSelIds(selIds);
721 entity.setDepartment(department);
722 entity.setMapProjectIds(mapProjectIds);
723 return entity;
724 }
725 }
726
727 /**
728 * @see Comparable#compareTo
729 */
730 public int compareTo(Quser o)
731 {
732 int cmp = 0;
733 if (this.getQuserId() != null)
734 {
735 cmp = this.getQuserId().compareTo(o.getQuserId());
736 }
737 else
738 {
739 if (this.getQuserCd() != null)
740 {
741 cmp = (cmp != 0 ? cmp : this.getQuserCd().compareTo(o.getQuserCd()));
742 }
743 if (this.getQuserLastNm() != null)
744 {
745 cmp = (cmp != 0 ? cmp : this.getQuserLastNm().compareTo(o.getQuserLastNm()));
746 }
747 if (this.getQuserFirstNm() != null)
748 {
749 cmp = (cmp != 0 ? cmp : this.getQuserFirstNm().compareTo(o.getQuserFirstNm()));
750 }
751 if (this.getQuserIntranetLg() != null)
752 {
753 cmp = (cmp != 0 ? cmp : this.getQuserIntranetLg().compareTo(o.getQuserIntranetLg()));
754 }
755 if (this.getQuserExtranetLg() != null)
756 {
757 cmp = (cmp != 0 ? cmp : this.getQuserExtranetLg().compareTo(o.getQuserExtranetLg()));
758 }
759 if (this.getQuserEMail() != null)
760 {
761 cmp = (cmp != 0 ? cmp : this.getQuserEMail().compareTo(o.getQuserEMail()));
762 }
763 if (this.getQuserAddress() != null)
764 {
765 cmp = (cmp != 0 ? cmp : this.getQuserAddress().compareTo(o.getQuserAddress()));
766 }
767 if (this.getQuserPhone() != null)
768 {
769 cmp = (cmp != 0 ? cmp : this.getQuserPhone().compareTo(o.getQuserPhone()));
770 }
771 if (this.getQuserOrgan() != null)
772 {
773 cmp = (cmp != 0 ? cmp : this.getQuserOrgan().compareTo(o.getQuserOrgan()));
774 }
775 if (this.getQuserAdminCenter() != null)
776 {
777 cmp = (cmp != 0 ? cmp : this.getQuserAdminCenter().compareTo(o.getQuserAdminCenter()));
778 }
779 if (this.getQuserSite() != null)
780 {
781 cmp = (cmp != 0 ? cmp : this.getQuserSite().compareTo(o.getQuserSite()));
782 }
783 if (this.getQuserLdapPresent() != null)
784 {
785 cmp = (cmp != 0 ? cmp : this.getQuserLdapPresent().compareTo(o.getQuserLdapPresent()));
786 }
787 if (this.getQuserCryptPassword() != null)
788 {
789 cmp = (cmp != 0 ? cmp : this.getQuserCryptPassword().compareTo(o.getQuserCryptPassword()));
790 }
791 if (this.getQuserCreationDt() != null)
792 {
793 cmp = (cmp != 0 ? cmp : this.getQuserCreationDt().compareTo(o.getQuserCreationDt()));
794 }
795 if (this.getUpdateDt() != null)
796 {
797 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
798 }
799 if (this.getQuserCm() != null)
800 {
801 cmp = (cmp != 0 ? cmp : this.getQuserCm().compareTo(o.getQuserCm()));
802 }
803 }
804 return cmp;
805 }
806 // HibernateEntity.vsl merge-point
807 // Quser.java merge-point
808 }