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.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.Status;
29  import java.io.Serializable;
30  import java.sql.Timestamp;
31  import java.util.Date;
32  
33  /**
34   * Transfert des droits entre un service et un autre service
35   */
36  // HibernateEntity.vsl annotations merge-point
37  public abstract class PrivilegeTransfer
38      implements Serializable, Comparable<PrivilegeTransfer>
39  {
40      /**
41       * The serial version UID of this class. Needed for serialization.
42       */
43      private static final long serialVersionUID = 1864781534107863371L;
44  
45      private PrivilegeTransferPK privilegeTransferPk;
46  
47      /**
48       * Get the composite primary key identifier class
49       * @return privilegeTransferPk
50       */
51      public PrivilegeTransferPK getPrivilegeTransferPk()
52      {
53          return this.privilegeTransferPk;
54      }
55  
56      /**
57       * Set the composite primary key identifier class
58       * @param privilegeTransferPkIn
59       */
60      public void setPrivilegeTransferPk(PrivilegeTransferPK privilegeTransferPkIn) {
61          this.privilegeTransferPk = privilegeTransferPkIn;
62      }
63  
64      // Generate 2 attributes
65      private Date privTransferDt;
66  
67      /**
68       * Date du transfert des droits entre service
69       * Cette date est mise à jours directement par le système (trigger car gestion sous SQL)
70       * @return this.privTransferDt Date
71       */
72      public Date getPrivTransferDt()
73      {
74          return this.privTransferDt;
75      }
76  
77      /**
78       * Date du transfert des droits entre service
79       * Cette date est mise à jours directement par le système (trigger car gestion sous SQL)
80       * @param privTransferDtIn Date
81       */
82      public void setPrivTransferDt(Date privTransferDtIn)
83      {
84          this.privTransferDt = privTransferDtIn;
85      }
86  
87      private Timestamp updateDt;
88  
89      /**
90       * Date de modification de l'objet, mise à jour par le système
91       * @return this.updateDt Timestamp
92       */
93      public Timestamp getUpdateDt()
94      {
95          return this.updateDt;
96      }
97  
98      /**
99       * Date de modification de l'objet, mise à jour par le système
100      * @param updateDtIn Timestamp
101      */
102     public void setUpdateDt(Timestamp updateDtIn)
103     {
104         this.updateDt = updateDtIn;
105     }
106 
107     // Generate 3 associations
108     private Status status;
109 
110     /**
111      * Liste des états possibles d'un objet.
112      * @return this.status Status
113      */
114     public Status getStatus()
115     {
116         return this.status;
117     }
118 
119     /**
120      * Liste des états possibles d'un objet.
121      * @param statusIn Status
122      */
123     public void setStatus(Status statusIn)
124     {
125         this.status = statusIn;
126     }
127 
128     private Department toDepartment;
129 
130     /**
131      * Liste les départements ou services auxquels sont rattachés les agents
132      * @return this.toDepartment Department
133      */
134     public Department getToDepartment()
135     {
136         return this.toDepartment;
137     }
138 
139     /**
140      * Liste les départements ou services auxquels sont rattachés les agents
141      * @param toDepartmentIn Department
142      */
143     public void setToDepartment(Department toDepartmentIn)
144     {
145         this.toDepartment = toDepartmentIn;
146     }
147 
148     private Department fromDepartment;
149 
150     /**
151      * Liste les départements ou services auxquels sont rattachés les agents
152      * @return this.fromDepartment Department
153      */
154     public Department getFromDepartment()
155     {
156         return this.fromDepartment;
157     }
158 
159     /**
160      * Liste les départements ou services auxquels sont rattachés les agents
161      * @param fromDepartmentIn Department
162      */
163     public void setFromDepartment(Department fromDepartmentIn)
164     {
165         this.fromDepartment = fromDepartmentIn;
166     }
167 
168     /**
169      * This entity does not have any identifiers
170      * and is not extending any other entity,
171      * so this method will only return <code>true</code> if the argument reference and <code>this</code>
172      * refer to the same object.
173      */
174     @Override
175     public boolean equals(Object object)
176     {
177         return super.equals(object);
178     }
179 
180     /**
181      * This entity does not have any identifiers
182      * and is not extending any other entity,
183      * so this method will only take the identifiers of this entity into account when calculating the hash code.
184      */
185     @Override
186     public int hashCode()
187     {
188         return super.hashCode();
189     }
190 
191     /**
192      * Constructs new instances of {@link PrivilegeTransfer}.
193      */
194     public static final class Factory
195     {
196         /**
197          * Constructs a new instance of {@link PrivilegeTransfer}.
198          * @return new PrivilegeTransferImpl()
199          */
200         public static PrivilegeTransfer newInstance()
201         {
202             return new PrivilegeTransferImpl();
203         }
204 
205         /**
206          * Constructs a new instance of {@link PrivilegeTransfer}, taking all required and/or
207          * read-only properties as arguments, except for identifiers.
208          * @param privTransferDt Date
209          * @param status Status
210          * @param toDepartment Department
211          * @param fromDepartment Department
212          * @return newInstance
213          */
214         public static PrivilegeTransfer newInstance(Date privTransferDt, Status status, Department toDepartment, Department fromDepartment)
215         {
216             final PrivilegeTransfer entity = new PrivilegeTransferImpl();
217             entity.setPrivTransferDt(privTransferDt);
218             entity.setStatus(status);
219             entity.setToDepartment(toDepartment);
220             entity.setFromDepartment(fromDepartment);
221             return entity;
222         }
223 
224         /**
225          * Constructs a new instance of {@link PrivilegeTransfer}, taking all possible properties
226          * (except the identifier(s))as arguments.
227          * @param privTransferDt Date
228          * @param updateDt Timestamp
229          * @param status Status
230          * @param toDepartment Department
231          * @param fromDepartment Department
232          * @return newInstance PrivilegeTransfer
233          */
234         public static PrivilegeTransfer newInstance(Date privTransferDt, Timestamp updateDt, Status status, Department toDepartment, Department fromDepartment)
235         {
236             final PrivilegeTransfer entity = new PrivilegeTransferImpl();
237             entity.setPrivTransferDt(privTransferDt);
238             entity.setUpdateDt(updateDt);
239             entity.setStatus(status);
240             entity.setToDepartment(toDepartment);
241             entity.setFromDepartment(fromDepartment);
242             return entity;
243         }
244     }
245 
246     /**
247      * @see Comparable#compareTo
248      */
249     public int compareTo(PrivilegeTransfer o)
250     {
251         int cmp = 0;
252         if (this.getPrivilegeTransferPk() != null)
253         {
254             cmp = this.getPrivilegeTransferPk().compareTo(o.getPrivilegeTransferPk());
255         }
256             if (this.getPrivTransferDt() != null)
257             {
258                 cmp = (cmp != 0 ? cmp : this.getPrivTransferDt().compareTo(o.getPrivTransferDt()));
259             }
260             if (this.getUpdateDt() != null)
261             {
262                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
263             }
264         return cmp;
265     }
266 // HibernateEntity.vsl merge-point
267 // PrivilegeTransfer.java merge-point
268 }