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.system.rule;
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 import java.util.Collection;
31 import java.util.Date;
32 import java.util.HashSet;
33
34 /**
35 * Cette table permet de conserver les fonctions de contrôle
36 */
37 // HibernateEntity.vsl annotations merge-point
38 public abstract class Function
39 implements Serializable, Comparable<Function>
40 {
41 /**
42 * The serial version UID of this class. Needed for serialization.
43 */
44 private static final long serialVersionUID = -6054206330509848492L;
45
46 // Generate 5 attributes
47 private Integer functionId;
48
49 /**
50 * Identifiant unique de la fonction
51 * @return this.functionId Integer
52 */
53 public Integer getFunctionId()
54 {
55 return this.functionId;
56 }
57
58 /**
59 * Identifiant unique de la fonction
60 * @param functionIdIn Integer
61 */
62 public void setFunctionId(Integer functionIdIn)
63 {
64 this.functionId = functionIdIn;
65 }
66
67 private String functionNm;
68
69 /**
70 * Libellé de la fonction
71 * @return this.functionNm String
72 */
73 public String getFunctionNm()
74 {
75 return this.functionNm;
76 }
77
78 /**
79 * Libellé de la fonction
80 * @param functionNmIn String
81 */
82 public void setFunctionNm(String functionNmIn)
83 {
84 this.functionNm = functionNmIn;
85 }
86
87 private String functionJavaFunctionClass;
88
89 /**
90 * Nom de la classe Java fournissant le code de la fonction : identifiant unique
91 * @return this.functionJavaFunctionClass String
92 */
93 public String getFunctionJavaFunctionClass()
94 {
95 return this.functionJavaFunctionClass;
96 }
97
98 /**
99 * Nom de la classe Java fournissant le code de la fonction : identifiant unique
100 * @param functionJavaFunctionClassIn String
101 */
102 public void setFunctionJavaFunctionClass(String functionJavaFunctionClassIn)
103 {
104 this.functionJavaFunctionClass = functionJavaFunctionClassIn;
105 }
106
107 private Date functionCreationDt;
108
109 /**
110 * Date de création de la fonction
111 * @return this.functionCreationDt Date
112 */
113 public Date getFunctionCreationDt()
114 {
115 return this.functionCreationDt;
116 }
117
118 /**
119 * Date de création de la fonction
120 * @param functionCreationDtIn Date
121 */
122 public void setFunctionCreationDt(Date functionCreationDtIn)
123 {
124 this.functionCreationDt = functionCreationDtIn;
125 }
126
127 private Timestamp updateDt;
128
129 /**
130 * Date de modification de l'objet, mise à jour par le système
131 * @return this.updateDt Timestamp
132 */
133 public Timestamp getUpdateDt()
134 {
135 return this.updateDt;
136 }
137
138 /**
139 * Date de modification de l'objet, mise à jour par le système
140 * @param updateDtIn Timestamp
141 */
142 public void setUpdateDt(Timestamp updateDtIn)
143 {
144 this.updateDt = updateDtIn;
145 }
146
147 // Generate 2 associations
148 private Collection<FunctionParameter> functionParameters = new HashSet<FunctionParameter>();
149
150 /**
151 * Cette table permet de conserver les paramètres des fonctions de contrôle
152 * @return this.functionParameters Collection<FunctionParameter>
153 */
154 public Collection<FunctionParameter> getFunctionParameters()
155 {
156 return this.functionParameters;
157 }
158
159 /**
160 * Cette table permet de conserver les paramètres des fonctions de contrôle
161 * @param functionParametersIn Collection<FunctionParameter>
162 */
163 public void setFunctionParameters(Collection<FunctionParameter> functionParametersIn)
164 {
165 this.functionParameters = functionParametersIn;
166 }
167
168 /**
169 * Cette table permet de conserver les paramètres des fonctions de contrôle
170 * @param elementToAdd FunctionParameter
171 * @return <tt>true</tt> if this collection changed as a result of the
172 * call
173 */
174 public boolean addFunctionParameters(FunctionParameter elementToAdd)
175 {
176 return this.functionParameters.add(elementToAdd);
177 }
178
179 /**
180 * Cette table permet de conserver les paramètres des fonctions de contrôle
181 * @param elementToRemove FunctionParameter
182 * @return <tt>true</tt> if this collection changed as a result of the
183 * call
184 */
185 public boolean removeFunctionParameters(FunctionParameter elementToRemove)
186 {
187 return this.functionParameters.remove(elementToRemove);
188 }
189
190 /**
191 * Returns <code>true</code> if the argument is an Function instance and all identifiers for this entity
192 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
193 */
194 @Override
195 public boolean equals(Object object)
196 {
197 if (this == object)
198 {
199 return true;
200 }
201 if (!(object instanceof Function))
202 {
203 return false;
204 }
205 final Function that = (Function)object;
206 if (this.functionId == null || that.getFunctionId() == null || !this.functionId.equals(that.getFunctionId()))
207 {
208 return false;
209 }
210 return true;
211 }
212
213 /**
214 * Returns a hash code based on this entity's identifiers.
215 */
216 @Override
217 public int hashCode()
218 {
219 int hashCode = 0;
220 hashCode = 29 * hashCode + (this.functionId == null ? 0 : this.functionId.hashCode());
221
222 return hashCode;
223 }
224
225 /**
226 * Constructs new instances of {@link Function}.
227 */
228 public static final class Factory
229 {
230 /**
231 * Constructs a new instance of {@link Function}.
232 * @return new FunctionImpl()
233 */
234 public static Function newInstance()
235 {
236 return new FunctionImpl();
237 }
238
239 /**
240 * Constructs a new instance of {@link Function}, taking all required and/or
241 * read-only properties as arguments, except for identifiers.
242 * @param functionNm String
243 * @param functionJavaFunctionClass String
244 * @param functionCreationDt Date
245 * @return newInstance
246 */
247 public static Function newInstance(String functionNm, String functionJavaFunctionClass, Date functionCreationDt)
248 {
249 final Function entity = new FunctionImpl();
250 entity.setFunctionNm(functionNm);
251 entity.setFunctionJavaFunctionClass(functionJavaFunctionClass);
252 entity.setFunctionCreationDt(functionCreationDt);
253 return entity;
254 }
255
256 /**
257 * Constructs a new instance of {@link Function}, taking all possible properties
258 * (except the identifier(s))as arguments.
259 * @param functionNm String
260 * @param functionJavaFunctionClass String
261 * @param functionCreationDt Date
262 * @param updateDt Timestamp
263 * @param functionParameters Collection<FunctionParameter>
264 * @return newInstance Function
265 */
266 public static Function newInstance(String functionNm, String functionJavaFunctionClass, Date functionCreationDt, Timestamp updateDt, Collection<FunctionParameter> functionParameters)
267 {
268 final Function entity = new FunctionImpl();
269 entity.setFunctionNm(functionNm);
270 entity.setFunctionJavaFunctionClass(functionJavaFunctionClass);
271 entity.setFunctionCreationDt(functionCreationDt);
272 entity.setUpdateDt(updateDt);
273 entity.setFunctionParameters(functionParameters);
274 return entity;
275 }
276 }
277
278 /**
279 * @see Comparable#compareTo
280 */
281 public int compareTo(Function o)
282 {
283 int cmp = 0;
284 if (this.getFunctionId() != null)
285 {
286 cmp = this.getFunctionId().compareTo(o.getFunctionId());
287 }
288 else
289 {
290 if (this.getFunctionNm() != null)
291 {
292 cmp = (cmp != 0 ? cmp : this.getFunctionNm().compareTo(o.getFunctionNm()));
293 }
294 if (this.getFunctionJavaFunctionClass() != null)
295 {
296 cmp = (cmp != 0 ? cmp : this.getFunctionJavaFunctionClass().compareTo(o.getFunctionJavaFunctionClass()));
297 }
298 if (this.getFunctionCreationDt() != null)
299 {
300 cmp = (cmp != 0 ? cmp : this.getFunctionCreationDt().compareTo(o.getFunctionCreationDt()));
301 }
302 if (this.getUpdateDt() != null)
303 {
304 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
305 }
306 }
307 return cmp;
308 }
309 // HibernateEntity.vsl merge-point
310 // Function.java merge-point
311 }