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.program;
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.administration.user.Department;
30 import java.io.Serializable;
31 import java.sql.Timestamp;
32
33 /**
34 * Liste des droits d'un service pour un programme particulier.
35 */
36 // HibernateEntity.vsl annotations merge-point
37 public abstract class ProgDepProgPriv
38 implements Serializable, Comparable<ProgDepProgPriv>
39 {
40 /**
41 * The serial version UID of this class. Needed for serialization.
42 */
43 private static final long serialVersionUID = 2852573315715789876L;
44
45 private ProgDepProgPrivPK progDepProgPrivPk;
46
47 /**
48 * Get the composite primary key identifier class
49 * @return progDepProgPrivPk
50 */
51 public ProgDepProgPrivPK getProgDepProgPrivPk()
52 {
53 return this.progDepProgPrivPk;
54 }
55
56 /**
57 * Set the composite primary key identifier class
58 * @param progDepProgPrivPkIn
59 */
60 public void setProgDepProgPrivPk(ProgDepProgPrivPK progDepProgPrivPkIn) {
61 this.progDepProgPrivPk = progDepProgPrivPkIn;
62 }
63
64 // Generate 1 attributes
65 private Timestamp updateDt;
66
67 /**
68 * Date de modification de l'objet, mise à jour par le système
69 * @return this.updateDt Timestamp
70 */
71 public Timestamp getUpdateDt()
72 {
73 return this.updateDt;
74 }
75
76 /**
77 * Date de modification de l'objet, mise à jour par le système
78 * @param updateDtIn Timestamp
79 */
80 public void setUpdateDt(Timestamp updateDtIn)
81 {
82 this.updateDt = updateDtIn;
83 }
84
85 // Generate 3 associations
86 private Department department;
87
88 /**
89 * Liste les départements ou services auxquels sont rattachés les agents
90 * @return this.department Department
91 */
92 public Department getDepartment()
93 {
94 return this.department;
95 }
96
97 /**
98 * Liste les départements ou services auxquels sont rattachés les agents
99 * @param departmentIn Department
100 */
101 public void setDepartment(Department departmentIn)
102 {
103 this.department = departmentIn;
104 }
105
106 private Program program;
107
108 /**
109 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
110 * @return this.program Program
111 */
112 public Program getProgram()
113 {
114 return this.program;
115 }
116
117 /**
118 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
119 * @param programIn Program
120 */
121 public void setProgram(Program programIn)
122 {
123 this.program = programIn;
124 }
125
126 private ProgramPrivilege programPrivilege;
127
128 /**
129 * types de privilège applicables sur un programme (responsable, consultation intégrale,
130 * saisisseur)
131 * @return this.programPrivilege ProgramPrivilege
132 */
133 public ProgramPrivilege getProgramPrivilege()
134 {
135 return this.programPrivilege;
136 }
137
138 /**
139 * types de privilège applicables sur un programme (responsable, consultation intégrale,
140 * saisisseur)
141 * @param programPrivilegeIn ProgramPrivilege
142 */
143 public void setProgramPrivilege(ProgramPrivilege programPrivilegeIn)
144 {
145 this.programPrivilege = programPrivilegeIn;
146 }
147
148 /**
149 * This entity does not have any identifiers
150 * and is not extending any other entity,
151 * so this method will only return <code>true</code> if the argument reference and <code>this</code>
152 * refer to the same object.
153 */
154 @Override
155 public boolean equals(Object object)
156 {
157 return super.equals(object);
158 }
159
160 /**
161 * This entity does not have any identifiers
162 * and is not extending any other entity,
163 * so this method will only take the identifiers of this entity into account when calculating the hash code.
164 */
165 @Override
166 public int hashCode()
167 {
168 return super.hashCode();
169 }
170
171 /**
172 * Constructs new instances of {@link ProgDepProgPriv}.
173 */
174 public static final class Factory
175 {
176 /**
177 * Constructs a new instance of {@link ProgDepProgPriv}.
178 * @return new ProgDepProgPrivImpl()
179 */
180 public static ProgDepProgPriv newInstance()
181 {
182 return new ProgDepProgPrivImpl();
183 }
184
185
186 /**
187 * Constructs a new instance of {@link ProgDepProgPriv}, taking all possible properties
188 * (except the identifier(s))as arguments.
189 * @param updateDt Timestamp
190 * @param department Department
191 * @param program Program
192 * @param programPrivilege ProgramPrivilege
193 * @return newInstance ProgDepProgPriv
194 */
195 public static ProgDepProgPriv newInstance(Timestamp updateDt, Department department, Program program, ProgramPrivilege programPrivilege)
196 {
197 final ProgDepProgPriv entity = new ProgDepProgPrivImpl();
198 entity.setUpdateDt(updateDt);
199 entity.setDepartment(department);
200 entity.setProgram(program);
201 entity.setProgramPrivilege(programPrivilege);
202 return entity;
203 }
204 }
205
206 /**
207 * @see Comparable#compareTo
208 */
209 public int compareTo(ProgDepProgPriv o)
210 {
211 int cmp = 0;
212 if (this.getProgDepProgPrivPk() != null)
213 {
214 cmp = this.getProgDepProgPrivPk().compareTo(o.getProgDepProgPrivPk());
215 }
216 if (this.getUpdateDt() != null)
217 {
218 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
219 }
220 return cmp;
221 }
222 // HibernateEntity.vsl merge-point
223 // ProgDepProgPriv.java merge-point
224 }