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.referential.pmfm;
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.Collection;
33 import java.util.HashSet;
34
35 /**
36 * Liste des groupes de paramètres.
37 */
38 // HibernateEntity.vsl annotations merge-point
39 public abstract class ParameterGroup
40 implements Serializable, Comparable<ParameterGroup>
41 {
42 /**
43 * The serial version UID of this class. Needed for serialization.
44 */
45 private static final long serialVersionUID = -1519673634674026670L;
46
47 // Generate 4 attributes
48 private Integer parGroupId;
49
50 /**
51 * Identifiant du groupe de paramètre
52 * @return this.parGroupId Integer
53 */
54 public Integer getParGroupId()
55 {
56 return this.parGroupId;
57 }
58
59 /**
60 * Identifiant du groupe de paramètre
61 * @param parGroupIdIn Integer
62 */
63 public void setParGroupId(Integer parGroupIdIn)
64 {
65 this.parGroupId = parGroupIdIn;
66 }
67
68 private String parGroupNm;
69
70 /**
71 * Libellé court
72 * @return this.parGroupNm String
73 */
74 public String getParGroupNm()
75 {
76 return this.parGroupNm;
77 }
78
79 /**
80 * Libellé court
81 * @param parGroupNmIn String
82 */
83 public void setParGroupNm(String parGroupNmIn)
84 {
85 this.parGroupNm = parGroupNmIn;
86 }
87
88 private String parGroupDc;
89
90 /**
91 * Description complète
92 * @return this.parGroupDc String
93 */
94 public String getParGroupDc()
95 {
96 return this.parGroupDc;
97 }
98
99 /**
100 * Description complète
101 * @param parGroupDcIn String
102 */
103 public void setParGroupDc(String parGroupDcIn)
104 {
105 this.parGroupDc = parGroupDcIn;
106 }
107
108 private Timestamp updateDt;
109
110 /**
111 * Date de modification de l'objet, mise à jour par le système
112 * @return this.updateDt Timestamp
113 */
114 public Timestamp getUpdateDt()
115 {
116 return this.updateDt;
117 }
118
119 /**
120 * Date de modification de l'objet, mise à jour par le système
121 * @param updateDtIn Timestamp
122 */
123 public void setUpdateDt(Timestamp updateDtIn)
124 {
125 this.updateDt = updateDtIn;
126 }
127
128 // Generate 4 associations
129 private Status status;
130
131 /**
132 * Liste des états possibles d'un objet.
133 * @return this.status Status
134 */
135 public Status getStatus()
136 {
137 return this.status;
138 }
139
140 /**
141 * Liste des états possibles d'un objet.
142 * @param statusIn Status
143 */
144 public void setStatus(Status statusIn)
145 {
146 this.status = statusIn;
147 }
148
149 private Collection<Parameter> parCds = new HashSet<Parameter>();
150
151 /**
152 * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
153 * @return this.parCds Collection<Parameter>
154 */
155 public Collection<Parameter> getParCds()
156 {
157 return this.parCds;
158 }
159
160 /**
161 * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
162 * @param parCdsIn Collection<Parameter>
163 */
164 public void setParCds(Collection<Parameter> parCdsIn)
165 {
166 this.parCds = parCdsIn;
167 }
168
169 /**
170 * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
171 * @param elementToAdd Parameter
172 * @return <tt>true</tt> if this collection changed as a result of the
173 * call
174 */
175 public boolean addParCds(Parameter elementToAdd)
176 {
177 return this.parCds.add(elementToAdd);
178 }
179
180 /**
181 * Liste les différents paramètres mesurés. Attention, voir PARAMETRE SISMER.
182 * @param elementToRemove Parameter
183 * @return <tt>true</tt> if this collection changed as a result of the
184 * call
185 */
186 public boolean removeParCds(Parameter elementToRemove)
187 {
188 return this.parCds.remove(elementToRemove);
189 }
190
191 private Collection<ParameterGroup> parameterGroups = new HashSet<ParameterGroup>();
192
193 /**
194 * Liste des groupes de paramètres.
195 * @return this.parameterGroups Collection<ParameterGroup>
196 */
197 public Collection<ParameterGroup> getParameterGroups()
198 {
199 return this.parameterGroups;
200 }
201
202 /**
203 * Liste des groupes de paramètres.
204 * @param parameterGroupsIn Collection<ParameterGroup>
205 */
206 public void setParameterGroups(Collection<ParameterGroup> parameterGroupsIn)
207 {
208 this.parameterGroups = parameterGroupsIn;
209 }
210
211 /**
212 * Liste des groupes de paramètres.
213 * @param elementToAdd ParameterGroup
214 * @return <tt>true</tt> if this collection changed as a result of the
215 * call
216 */
217 public boolean addParameterGroups(ParameterGroup elementToAdd)
218 {
219 return this.parameterGroups.add(elementToAdd);
220 }
221
222 /**
223 * Liste des groupes de paramètres.
224 * @param elementToRemove ParameterGroup
225 * @return <tt>true</tt> if this collection changed as a result of the
226 * call
227 */
228 public boolean removeParameterGroups(ParameterGroup elementToRemove)
229 {
230 return this.parameterGroups.remove(elementToRemove);
231 }
232
233 private ParameterGroup parentParGroupId;
234
235 /**
236 * Liste des groupes de paramètres.
237 * @return this.parentParGroupId ParameterGroup
238 */
239 public ParameterGroup getParentParGroupId()
240 {
241 return this.parentParGroupId;
242 }
243
244 /**
245 * Liste des groupes de paramètres.
246 * @param parentParGroupIdIn ParameterGroup
247 */
248 public void setParentParGroupId(ParameterGroup parentParGroupIdIn)
249 {
250 this.parentParGroupId = parentParGroupIdIn;
251 }
252
253 /**
254 * Returns <code>true</code> if the argument is an ParameterGroup instance and all identifiers for this entity
255 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
256 */
257 @Override
258 public boolean equals(Object object)
259 {
260 if (this == object)
261 {
262 return true;
263 }
264 if (!(object instanceof ParameterGroup))
265 {
266 return false;
267 }
268 final ParameterGroup that = (ParameterGroup)object;
269 if (this.parGroupId == null || that.getParGroupId() == null || !this.parGroupId.equals(that.getParGroupId()))
270 {
271 return false;
272 }
273 return true;
274 }
275
276 /**
277 * Returns a hash code based on this entity's identifiers.
278 */
279 @Override
280 public int hashCode()
281 {
282 int hashCode = 0;
283 hashCode = 29 * hashCode + (this.parGroupId == null ? 0 : this.parGroupId.hashCode());
284
285 return hashCode;
286 }
287
288 /**
289 * Constructs new instances of {@link ParameterGroup}.
290 */
291 public static final class Factory
292 {
293 /**
294 * Constructs a new instance of {@link ParameterGroup}.
295 * @return new ParameterGroupImpl()
296 */
297 public static ParameterGroup newInstance()
298 {
299 return new ParameterGroupImpl();
300 }
301
302 /**
303 * Constructs a new instance of {@link ParameterGroup}, taking all required and/or
304 * read-only properties as arguments, except for identifiers.
305 * @param parGroupNm String
306 * @param updateDt Timestamp
307 * @param status Status
308 * @return newInstance
309 */
310 public static ParameterGroup newInstance(String parGroupNm, Timestamp updateDt, Status status)
311 {
312 final ParameterGroup entity = new ParameterGroupImpl();
313 entity.setParGroupNm(parGroupNm);
314 entity.setUpdateDt(updateDt);
315 entity.setStatus(status);
316 return entity;
317 }
318
319 /**
320 * Constructs a new instance of {@link ParameterGroup}, taking all possible properties
321 * (except the identifier(s))as arguments.
322 * @param parGroupNm String
323 * @param parGroupDc String
324 * @param updateDt Timestamp
325 * @param status Status
326 * @param parCds Collection<Parameter>
327 * @param parameterGroups Collection<ParameterGroup>
328 * @param parentParGroupId ParameterGroup
329 * @return newInstance ParameterGroup
330 */
331 public static ParameterGroup newInstance(String parGroupNm, String parGroupDc, Timestamp updateDt, Status status, Collection<Parameter> parCds, Collection<ParameterGroup> parameterGroups, ParameterGroup parentParGroupId)
332 {
333 final ParameterGroup entity = new ParameterGroupImpl();
334 entity.setParGroupNm(parGroupNm);
335 entity.setParGroupDc(parGroupDc);
336 entity.setUpdateDt(updateDt);
337 entity.setStatus(status);
338 entity.setParCds(parCds);
339 entity.setParameterGroups(parameterGroups);
340 entity.setParentParGroupId(parentParGroupId);
341 return entity;
342 }
343 }
344
345 /**
346 * @see Comparable#compareTo
347 */
348 public int compareTo(ParameterGroup o)
349 {
350 int cmp = 0;
351 if (this.getParGroupId() != null)
352 {
353 cmp = this.getParGroupId().compareTo(o.getParGroupId());
354 }
355 else
356 {
357 if (this.getParGroupNm() != null)
358 {
359 cmp = (cmp != 0 ? cmp : this.getParGroupNm().compareTo(o.getParGroupNm()));
360 }
361 if (this.getParGroupDc() != null)
362 {
363 cmp = (cmp != 0 ? cmp : this.getParGroupDc().compareTo(o.getParGroupDc()));
364 }
365 if (this.getUpdateDt() != null)
366 {
367 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
368 }
369 }
370 return cmp;
371 }
372 // HibernateEntity.vsl merge-point
373 // ParameterGroup.java merge-point
374 }