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