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