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;
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.sandre.SandreQualityLevelExp;
30 import fr.ifremer.quadrige2.core.dao.sandre.SandreQualityLevelImp;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33 import java.util.Collection;
34 import java.util.HashSet;
35
36 /**
37 * Liste des niveaux de qualification.
38 */
39 // HibernateEntity.vsl annotations merge-point
40 public abstract class QualityFlag
41 implements Serializable, Comparable<QualityFlag>
42 {
43 /**
44 * The serial version UID of this class. Needed for serialization.
45 */
46 private static final long serialVersionUID = 1683091495343672195L;
47
48 // Generate 4 attributes
49 private String qualFlagCd;
50
51 /**
52 * Code identifiant le niveau de qualification (0,1,2, 3,4).
53 * @return this.qualFlagCd String
54 */
55 public String getQualFlagCd()
56 {
57 return this.qualFlagCd;
58 }
59
60 /**
61 * Code identifiant le niveau de qualification (0,1,2, 3,4).
62 * @param qualFlagCdIn String
63 */
64 public void setQualFlagCd(String qualFlagCdIn)
65 {
66 this.qualFlagCd = qualFlagCdIn;
67 }
68
69 private String qualFlagNm;
70
71 /**
72 * Libellé du niveau de qualification
73 * @return this.qualFlagNm String
74 */
75 public String getQualFlagNm()
76 {
77 return this.qualFlagNm;
78 }
79
80 /**
81 * Libellé du niveau de qualification
82 * @param qualFlagNmIn String
83 */
84 public void setQualFlagNm(String qualFlagNmIn)
85 {
86 this.qualFlagNm = qualFlagNmIn;
87 }
88
89 private String qualFlagDc;
90
91 /**
92 * Description optionnelle de la qualification
93 * @return this.qualFlagDc String
94 */
95 public String getQualFlagDc()
96 {
97 return this.qualFlagDc;
98 }
99
100 /**
101 * Description optionnelle de la qualification
102 * @param qualFlagDcIn String
103 */
104 public void setQualFlagDc(String qualFlagDcIn)
105 {
106 this.qualFlagDc = qualFlagDcIn;
107 }
108
109 private Timestamp updateDt;
110
111 /**
112 * Date de modification de l'objet, mise à jour par le système
113 * @return this.updateDt Timestamp
114 */
115 public Timestamp getUpdateDt()
116 {
117 return this.updateDt;
118 }
119
120 /**
121 * Date de modification de l'objet, mise à jour par le système
122 * @param updateDtIn Timestamp
123 */
124 public void setUpdateDt(Timestamp updateDtIn)
125 {
126 this.updateDt = updateDtIn;
127 }
128
129 // Generate 17 associations
130 private Collection<SandreQualityLevelExp> sandreQualityLevelExpIds = new HashSet<SandreQualityLevelExp>();
131
132 /**
133 * Niveau de qualité sandre pour les exports de données
134 * @return this.sandreQualityLevelExpIds Collection<SandreQualityLevelExp>
135 */
136 public Collection<SandreQualityLevelExp> getSandreQualityLevelExpIds()
137 {
138 return this.sandreQualityLevelExpIds;
139 }
140
141 /**
142 * Niveau de qualité sandre pour les exports de données
143 * @param sandreQualityLevelExpIdsIn Collection<SandreQualityLevelExp>
144 */
145 public void setSandreQualityLevelExpIds(Collection<SandreQualityLevelExp> sandreQualityLevelExpIdsIn)
146 {
147 this.sandreQualityLevelExpIds = sandreQualityLevelExpIdsIn;
148 }
149
150 /**
151 * Niveau de qualité sandre pour les exports de données
152 * @param elementToAdd SandreQualityLevelExp
153 * @return <tt>true</tt> if this collection changed as a result of the
154 * call
155 */
156 public boolean addSandreQualityLevelExpIds(SandreQualityLevelExp elementToAdd)
157 {
158 return this.sandreQualityLevelExpIds.add(elementToAdd);
159 }
160
161 /**
162 * Niveau de qualité sandre pour les exports de données
163 * @param elementToRemove SandreQualityLevelExp
164 * @return <tt>true</tt> if this collection changed as a result of the
165 * call
166 */
167 public boolean removeSandreQualityLevelExpIds(SandreQualityLevelExp elementToRemove)
168 {
169 return this.sandreQualityLevelExpIds.remove(elementToRemove);
170 }
171
172 private Status status;
173
174 /**
175 * Liste des états possibles d'un objet.
176 * @return this.status Status
177 */
178 public Status getStatus()
179 {
180 return this.status;
181 }
182
183 /**
184 * Liste des états possibles d'un objet.
185 * @param statusIn Status
186 */
187 public void setStatus(Status statusIn)
188 {
189 this.status = statusIn;
190 }
191
192 private Collection<SandreQualityLevelImp> sandreQualityLevelImpIds = new HashSet<SandreQualityLevelImp>();
193
194 /**
195 * Niveau de qualité sandre pour les imports de données
196 * @return this.sandreQualityLevelImpIds Collection<SandreQualityLevelImp>
197 */
198 public Collection<SandreQualityLevelImp> getSandreQualityLevelImpIds()
199 {
200 return this.sandreQualityLevelImpIds;
201 }
202
203 /**
204 * Niveau de qualité sandre pour les imports de données
205 * @param sandreQualityLevelImpIdsIn Collection<SandreQualityLevelImp>
206 */
207 public void setSandreQualityLevelImpIds(Collection<SandreQualityLevelImp> sandreQualityLevelImpIdsIn)
208 {
209 this.sandreQualityLevelImpIds = sandreQualityLevelImpIdsIn;
210 }
211
212 /**
213 * Niveau de qualité sandre pour les imports de données
214 * @param elementToAdd SandreQualityLevelImp
215 * @return <tt>true</tt> if this collection changed as a result of the
216 * call
217 */
218 public boolean addSandreQualityLevelImpIds(SandreQualityLevelImp elementToAdd)
219 {
220 return this.sandreQualityLevelImpIds.add(elementToAdd);
221 }
222
223 /**
224 * Niveau de qualité sandre pour les imports de données
225 * @param elementToRemove SandreQualityLevelImp
226 * @return <tt>true</tt> if this collection changed as a result of the
227 * call
228 */
229 public boolean removeSandreQualityLevelImpIds(SandreQualityLevelImp elementToRemove)
230 {
231 return this.sandreQualityLevelImpIds.remove(elementToRemove);
232 }
233
234 /**
235 * Returns <code>true</code> if the argument is an QualityFlag instance and all identifiers for this entity
236 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
237 */
238 @Override
239 public boolean equals(Object object)
240 {
241 if (this == object)
242 {
243 return true;
244 }
245 if (!(object instanceof QualityFlag))
246 {
247 return false;
248 }
249 final QualityFlag that = (QualityFlag)object;
250 if (this.qualFlagCd == null || that.getQualFlagCd() == null || !this.qualFlagCd.equals(that.getQualFlagCd()))
251 {
252 return false;
253 }
254 return true;
255 }
256
257 /**
258 * Returns a hash code based on this entity's identifiers.
259 */
260 @Override
261 public int hashCode()
262 {
263 int hashCode = 0;
264 hashCode = 29 * hashCode + (this.qualFlagCd == null ? 0 : this.qualFlagCd.hashCode());
265
266 return hashCode;
267 }
268
269 /**
270 * Constructs new instances of {@link QualityFlag}.
271 */
272 public static final class Factory
273 {
274 /**
275 * Constructs a new instance of {@link QualityFlag}.
276 * @return new QualityFlagImpl()
277 */
278 public static QualityFlag newInstance()
279 {
280 return new QualityFlagImpl();
281 }
282
283 /**
284 * Constructs a new instance of {@link QualityFlag}, taking all required and/or
285 * read-only properties as arguments, except for identifiers.
286 * @param qualFlagNm String
287 * @param updateDt Timestamp
288 * @param status Status
289 * @return newInstance
290 */
291 public static QualityFlag newInstance(String qualFlagNm, Timestamp updateDt, Status status)
292 {
293 final QualityFlag entity = new QualityFlagImpl();
294 entity.setQualFlagNm(qualFlagNm);
295 entity.setUpdateDt(updateDt);
296 entity.setStatus(status);
297 return entity;
298 }
299
300 /**
301 * Constructs a new instance of {@link QualityFlag}, taking all possible properties
302 * (except the identifier(s))as arguments.
303 * @param qualFlagNm String
304 * @param qualFlagDc String
305 * @param updateDt Timestamp
306 * @param sandreQualityLevelExpIds Collection<SandreQualityLevelExp>
307 * @param status Status
308 * @param sandreQualityLevelImpIds Collection<SandreQualityLevelImp>
309 * @return newInstance QualityFlag
310 */
311 public static QualityFlag newInstance(String qualFlagNm, String qualFlagDc, Timestamp updateDt, Collection<SandreQualityLevelExp> sandreQualityLevelExpIds, Status status, Collection<SandreQualityLevelImp> sandreQualityLevelImpIds)
312 {
313 final QualityFlag entity = new QualityFlagImpl();
314 entity.setQualFlagNm(qualFlagNm);
315 entity.setQualFlagDc(qualFlagDc);
316 entity.setUpdateDt(updateDt);
317 entity.setSandreQualityLevelExpIds(sandreQualityLevelExpIds);
318 entity.setStatus(status);
319 entity.setSandreQualityLevelImpIds(sandreQualityLevelImpIds);
320 return entity;
321 }
322 }
323
324 /**
325 * @see Comparable#compareTo
326 */
327 public int compareTo(QualityFlag o)
328 {
329 int cmp = 0;
330 if (this.getQualFlagCd() != null)
331 {
332 cmp = this.getQualFlagCd().compareTo(o.getQualFlagCd());
333 }
334 else
335 {
336 if (this.getQualFlagNm() != null)
337 {
338 cmp = (cmp != 0 ? cmp : this.getQualFlagNm().compareTo(o.getQualFlagNm()));
339 }
340 if (this.getQualFlagDc() != null)
341 {
342 cmp = (cmp != 0 ? cmp : this.getQualFlagDc().compareTo(o.getQualFlagDc()));
343 }
344 if (this.getUpdateDt() != null)
345 {
346 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
347 }
348 }
349 return cmp;
350 }
351 // HibernateEntity.vsl merge-point
352 // QualityFlag.java merge-point
353 }