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 java.io.Serializable;
29 import java.sql.Timestamp;
30
31 /**
32 * types de privilège applicables sur un programme (responsable, consultation intégrale, saisisseur)
33 */
34 // HibernateEntity.vsl annotations merge-point
35 public abstract class ProgramPrivilege
36 implements Serializable, Comparable<ProgramPrivilege>
37 {
38 /**
39 * The serial version UID of this class. Needed for serialization.
40 */
41 private static final long serialVersionUID = 5930663967612181687L;
42
43 // Generate 4 attributes
44 private Integer progPrivId;
45
46 /**
47 * Identifiant du privilège (droit) sur les programmes
48 * @return this.progPrivId Integer
49 */
50 public Integer getProgPrivId()
51 {
52 return this.progPrivId;
53 }
54
55 /**
56 * Identifiant du privilège (droit) sur les programmes
57 * @param progPrivIdIn Integer
58 */
59 public void setProgPrivId(Integer progPrivIdIn)
60 {
61 this.progPrivId = progPrivIdIn;
62 }
63
64 private String progPrivNm;
65
66 /**
67 * Libellé du privilège
68 * @return this.progPrivNm String
69 */
70 public String getProgPrivNm()
71 {
72 return this.progPrivNm;
73 }
74
75 /**
76 * Libellé du privilège
77 * @param progPrivNmIn String
78 */
79 public void setProgPrivNm(String progPrivNmIn)
80 {
81 this.progPrivNm = progPrivNmIn;
82 }
83
84 private String progPrivDc;
85
86 /**
87 * Description du privilège
88 * @return this.progPrivDc String
89 */
90 public String getProgPrivDc()
91 {
92 return this.progPrivDc;
93 }
94
95 /**
96 * Description du privilège
97 * @param progPrivDcIn String
98 */
99 public void setProgPrivDc(String progPrivDcIn)
100 {
101 this.progPrivDc = progPrivDcIn;
102 }
103
104 private Timestamp updateDt;
105
106 /**
107 * Date de modification de l'objet, mise à jour par le système
108 * @return this.updateDt Timestamp
109 */
110 public Timestamp getUpdateDt()
111 {
112 return this.updateDt;
113 }
114
115 /**
116 * Date de modification de l'objet, mise à jour par le système
117 * @param updateDtIn Timestamp
118 */
119 public void setUpdateDt(Timestamp updateDtIn)
120 {
121 this.updateDt = updateDtIn;
122 }
123
124 // Generate 2 associations
125 /**
126 * Returns <code>true</code> if the argument is an ProgramPrivilege instance and all identifiers for this entity
127 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
128 */
129 @Override
130 public boolean equals(Object object)
131 {
132 if (this == object)
133 {
134 return true;
135 }
136 if (!(object instanceof ProgramPrivilege))
137 {
138 return false;
139 }
140 final ProgramPrivilege that = (ProgramPrivilege)object;
141 if (this.progPrivId == null || that.getProgPrivId() == null || !this.progPrivId.equals(that.getProgPrivId()))
142 {
143 return false;
144 }
145 return true;
146 }
147
148 /**
149 * Returns a hash code based on this entity's identifiers.
150 */
151 @Override
152 public int hashCode()
153 {
154 int hashCode = 0;
155 hashCode = 29 * hashCode + (this.progPrivId == null ? 0 : this.progPrivId.hashCode());
156
157 return hashCode;
158 }
159
160 /**
161 * Constructs new instances of {@link ProgramPrivilege}.
162 */
163 public static final class Factory
164 {
165 /**
166 * Constructs a new instance of {@link ProgramPrivilege}.
167 * @return new ProgramPrivilegeImpl()
168 */
169 public static ProgramPrivilege newInstance()
170 {
171 return new ProgramPrivilegeImpl();
172 }
173
174 /**
175 * Constructs a new instance of {@link ProgramPrivilege}, taking all required and/or
176 * read-only properties as arguments, except for identifiers.
177 * @param progPrivNm String
178 * @return newInstance
179 */
180 public static ProgramPrivilege newInstance(String progPrivNm)
181 {
182 final ProgramPrivilege entity = new ProgramPrivilegeImpl();
183 entity.setProgPrivNm(progPrivNm);
184 return entity;
185 }
186
187 /**
188 * Constructs a new instance of {@link ProgramPrivilege}, taking all possible properties
189 * (except the identifier(s))as arguments.
190 * @param progPrivNm String
191 * @param progPrivDc String
192 * @param updateDt Timestamp
193 * @return newInstance ProgramPrivilege
194 */
195 public static ProgramPrivilege newInstance(String progPrivNm, String progPrivDc, Timestamp updateDt)
196 {
197 final ProgramPrivilege entity = new ProgramPrivilegeImpl();
198 entity.setProgPrivNm(progPrivNm);
199 entity.setProgPrivDc(progPrivDc);
200 entity.setUpdateDt(updateDt);
201 return entity;
202 }
203 }
204
205 /**
206 * @see Comparable#compareTo
207 */
208 public int compareTo(ProgramPrivilege o)
209 {
210 int cmp = 0;
211 if (this.getProgPrivId() != null)
212 {
213 cmp = this.getProgPrivId().compareTo(o.getProgPrivId());
214 }
215 else
216 {
217 if (this.getProgPrivNm() != null)
218 {
219 cmp = (cmp != 0 ? cmp : this.getProgPrivNm().compareTo(o.getProgPrivNm()));
220 }
221 if (this.getProgPrivDc() != null)
222 {
223 cmp = (cmp != 0 ? cmp : this.getProgPrivDc().compareTo(o.getProgPrivDc()));
224 }
225 if (this.getUpdateDt() != null)
226 {
227 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
228 }
229 }
230 return cmp;
231 }
232 // HibernateEntity.vsl merge-point
233 // ProgramPrivilege.java merge-point
234 }