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