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.data.survey;
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.administration.program.Program;
30 import fr.ifremer.quadrige2.core.dao.administration.user.Department;
31 import fr.ifremer.quadrige2.core.dao.referential.QualityFlag;
32 import java.io.Serializable;
33 import java.sql.Timestamp;
34 import java.util.Collection;
35 import java.util.Date;
36 import java.util.HashSet;
37
38 /**
39 * Profil mesuré envoyé à Coriolis
40 * La référence des profils est QUADRIGE-DDMMYYYY-XXXX
41 * Elle est générée à partir de l'identifiant, de la date de création et d'une chaine en dur.
42 */
43 // HibernateEntity.vsl annotations merge-point
44 public abstract class MeasuredProfile
45 implements Serializable, Comparable<MeasuredProfile>
46 {
47 /**
48 * The serial version UID of this class. Needed for serialization.
49 */
50 private static final long serialVersionUID = 1999795957791859405L;
51
52 // Generate 8 attributes
53 private Integer measProfId;
54
55 /**
56 * Identifiant du profil. Cet identifiant permet de faire le lien vers les autres systèmes
57 * d'information de l'Ifremer.
58 * @return this.measProfId Integer
59 */
60 public Integer getMeasProfId()
61 {
62 return this.measProfId;
63 }
64
65 /**
66 * Identifiant du profil. Cet identifiant permet de faire le lien vers les autres systèmes
67 * d'information de l'Ifremer.
68 * @param measProfIdIn Integer
69 */
70 public void setMeasProfId(Integer measProfIdIn)
71 {
72 this.measProfId = measProfIdIn;
73 }
74
75 private String measProfDc;
76
77 /**
78 * Description du profil
79 * @return this.measProfDc String
80 */
81 public String getMeasProfDc()
82 {
83 return this.measProfDc;
84 }
85
86 /**
87 * Description du profil
88 * @param measProfDcIn String
89 */
90 public void setMeasProfDc(String measProfDcIn)
91 {
92 this.measProfDc = measProfDcIn;
93 }
94
95 private String measProfUpload;
96
97 /**
98 * Vrai si le traitement CORIOLIS du profil s'est bien passé
99 * @return this.measProfUpload String
100 */
101 public String getMeasProfUpload()
102 {
103 return this.measProfUpload;
104 }
105
106 /**
107 * Vrai si le traitement CORIOLIS du profil s'est bien passé
108 * @param measProfUploadIn String
109 */
110 public void setMeasProfUpload(String measProfUploadIn)
111 {
112 this.measProfUpload = measProfUploadIn;
113 }
114
115 private Date measProfCreationDt;
116
117 /**
118 * Date de création de l'objet
119 * @return this.measProfCreationDt Date
120 */
121 public Date getMeasProfCreationDt()
122 {
123 return this.measProfCreationDt;
124 }
125
126 /**
127 * Date de création de l'objet
128 * @param measProfCreationDtIn Date
129 */
130 public void setMeasProfCreationDt(Date measProfCreationDtIn)
131 {
132 this.measProfCreationDt = measProfCreationDtIn;
133 }
134
135 private Timestamp updateDt;
136
137 /**
138 * Date de mise à jour de l'objet
139 * @return this.updateDt Timestamp
140 */
141 public Timestamp getUpdateDt()
142 {
143 return this.updateDt;
144 }
145
146 /**
147 * Date de mise à jour de l'objet
148 * @param updateDtIn Timestamp
149 */
150 public void setUpdateDt(Timestamp updateDtIn)
151 {
152 this.updateDt = updateDtIn;
153 }
154
155 private Date measProfValidDt;
156
157 /**
158 * Date de validation
159 * @return this.measProfValidDt Date
160 */
161 public Date getMeasProfValidDt()
162 {
163 return this.measProfValidDt;
164 }
165
166 /**
167 * Date de validation
168 * @param measProfValidDtIn Date
169 */
170 public void setMeasProfValidDt(Date measProfValidDtIn)
171 {
172 this.measProfValidDt = measProfValidDtIn;
173 }
174
175 private Date measProfQualifDt;
176
177 /**
178 * Date de qualification
179 * @return this.measProfQualifDt Date
180 */
181 public Date getMeasProfQualifDt()
182 {
183 return this.measProfQualifDt;
184 }
185
186 /**
187 * Date de qualification
188 * @param measProfQualifDtIn Date
189 */
190 public void setMeasProfQualifDt(Date measProfQualifDtIn)
191 {
192 this.measProfQualifDt = measProfQualifDtIn;
193 }
194
195 private String measProfQualifCm;
196
197 /**
198 * Commentaire de qualification
199 * @return this.measProfQualifCm String
200 */
201 public String getMeasProfQualifCm()
202 {
203 return this.measProfQualifCm;
204 }
205
206 /**
207 * Commentaire de qualification
208 * @param measProfQualifCmIn String
209 */
210 public void setMeasProfQualifCm(String measProfQualifCmIn)
211 {
212 this.measProfQualifCm = measProfQualifCmIn;
213 }
214
215 // Generate 4 associations
216 private Collection<Program> programs = new HashSet<Program>();
217
218 /**
219 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
220 * @return this.programs Collection<Program>
221 */
222 public Collection<Program> getPrograms()
223 {
224 return this.programs;
225 }
226
227 /**
228 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
229 * @param programsIn Collection<Program>
230 */
231 public void setPrograms(Collection<Program> programsIn)
232 {
233 this.programs = programsIn;
234 }
235
236 /**
237 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
238 * @param elementToAdd Program
239 * @return <tt>true</tt> if this collection changed as a result of the
240 * call
241 */
242 public boolean addPrograms(Program elementToAdd)
243 {
244 return this.programs.add(elementToAdd);
245 }
246
247 /**
248 * Activités à l'origine de la collecte d'un ensemble cohérent de données.
249 * @param elementToRemove Program
250 * @return <tt>true</tt> if this collection changed as a result of the
251 * call
252 */
253 public boolean removePrograms(Program elementToRemove)
254 {
255 return this.programs.remove(elementToRemove);
256 }
257
258 private Survey survey;
259
260 /**
261 * Liste les différents passages effectués sur un lieu de surveillance.
262 * Liste les différents passages effectués sur un lieu de surveillance.
263 * @return this.survey Survey
264 */
265 public Survey getSurvey()
266 {
267 return this.survey;
268 }
269
270 /**
271 * Liste les différents passages effectués sur un lieu de surveillance.
272 * Liste les différents passages effectués sur un lieu de surveillance.
273 * @param surveyIn Survey
274 */
275 public void setSurvey(Survey surveyIn)
276 {
277 this.survey = surveyIn;
278 }
279
280 private QualityFlag qualityFlag;
281
282 /**
283 * Liste des niveaux de qualification.
284 * @return this.qualityFlag QualityFlag
285 */
286 public QualityFlag getQualityFlag()
287 {
288 return this.qualityFlag;
289 }
290
291 /**
292 * Liste des niveaux de qualification.
293 * @param qualityFlagIn QualityFlag
294 */
295 public void setQualityFlag(QualityFlag qualityFlagIn)
296 {
297 this.qualityFlag = qualityFlagIn;
298 }
299
300 private Department recorderDepartment;
301
302 /**
303 * Liste les départements ou services auxquels sont rattachés les agents
304 * @return this.recorderDepartment Department
305 */
306 public Department getRecorderDepartment()
307 {
308 return this.recorderDepartment;
309 }
310
311 /**
312 * Liste les départements ou services auxquels sont rattachés les agents
313 * @param recorderDepartmentIn Department
314 */
315 public void setRecorderDepartment(Department recorderDepartmentIn)
316 {
317 this.recorderDepartment = recorderDepartmentIn;
318 }
319
320 /**
321 * Returns <code>true</code> if the argument is an MeasuredProfile instance and all identifiers for this entity
322 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
323 */
324 @Override
325 public boolean equals(Object object)
326 {
327 if (this == object)
328 {
329 return true;
330 }
331 if (!(object instanceof MeasuredProfile))
332 {
333 return false;
334 }
335 final MeasuredProfile that = (MeasuredProfile)object;
336 if (this.measProfId == null || that.getMeasProfId() == null || !this.measProfId.equals(that.getMeasProfId()))
337 {
338 return false;
339 }
340 return true;
341 }
342
343 /**
344 * Returns a hash code based on this entity's identifiers.
345 */
346 @Override
347 public int hashCode()
348 {
349 int hashCode = 0;
350 hashCode = 29 * hashCode + (this.measProfId == null ? 0 : this.measProfId.hashCode());
351
352 return hashCode;
353 }
354
355 /**
356 * Constructs new instances of {@link MeasuredProfile}.
357 */
358 public static final class Factory
359 {
360 /**
361 * Constructs a new instance of {@link MeasuredProfile}.
362 * @return new MeasuredProfileImpl()
363 */
364 public static MeasuredProfile newInstance()
365 {
366 return new MeasuredProfileImpl();
367 }
368
369 /**
370 * Constructs a new instance of {@link MeasuredProfile}, taking all required and/or
371 * read-only properties as arguments, except for identifiers.
372 * @param measProfCreationDt Date
373 * @param updateDt Timestamp
374 * @param recorderDepartment Department
375 * @return newInstance
376 */
377 public static MeasuredProfile newInstance(Date measProfCreationDt, Timestamp updateDt, Department recorderDepartment)
378 {
379 final MeasuredProfile entity = new MeasuredProfileImpl();
380 entity.setMeasProfCreationDt(measProfCreationDt);
381 entity.setUpdateDt(updateDt);
382 entity.setRecorderDepartment(recorderDepartment);
383 return entity;
384 }
385
386 /**
387 * Constructs a new instance of {@link MeasuredProfile}, taking all possible properties
388 * (except the identifier(s))as arguments.
389 * @param measProfDc String
390 * @param measProfUpload String
391 * @param measProfCreationDt Date
392 * @param updateDt Timestamp
393 * @param measProfValidDt Date
394 * @param measProfQualifDt Date
395 * @param measProfQualifCm String
396 * @param programs Collection<Program>
397 * @param survey Survey
398 * @param qualityFlag QualityFlag
399 * @param recorderDepartment Department
400 * @return newInstance MeasuredProfile
401 */
402 public static MeasuredProfile newInstance(String measProfDc, String measProfUpload, Date measProfCreationDt, Timestamp updateDt, Date measProfValidDt, Date measProfQualifDt, String measProfQualifCm, Collection<Program> programs, Survey survey, QualityFlag qualityFlag, Department recorderDepartment)
403 {
404 final MeasuredProfile entity = new MeasuredProfileImpl();
405 entity.setMeasProfDc(measProfDc);
406 entity.setMeasProfUpload(measProfUpload);
407 entity.setMeasProfCreationDt(measProfCreationDt);
408 entity.setUpdateDt(updateDt);
409 entity.setMeasProfValidDt(measProfValidDt);
410 entity.setMeasProfQualifDt(measProfQualifDt);
411 entity.setMeasProfQualifCm(measProfQualifCm);
412 entity.setPrograms(programs);
413 entity.setSurvey(survey);
414 entity.setQualityFlag(qualityFlag);
415 entity.setRecorderDepartment(recorderDepartment);
416 return entity;
417 }
418 }
419
420 /**
421 * @see Comparable#compareTo
422 */
423 public int compareTo(MeasuredProfile o)
424 {
425 int cmp = 0;
426 if (this.getMeasProfId() != null)
427 {
428 cmp = this.getMeasProfId().compareTo(o.getMeasProfId());
429 }
430 else
431 {
432 if (this.getMeasProfDc() != null)
433 {
434 cmp = (cmp != 0 ? cmp : this.getMeasProfDc().compareTo(o.getMeasProfDc()));
435 }
436 if (this.getMeasProfUpload() != null)
437 {
438 cmp = (cmp != 0 ? cmp : this.getMeasProfUpload().compareTo(o.getMeasProfUpload()));
439 }
440 if (this.getMeasProfCreationDt() != null)
441 {
442 cmp = (cmp != 0 ? cmp : this.getMeasProfCreationDt().compareTo(o.getMeasProfCreationDt()));
443 }
444 if (this.getUpdateDt() != null)
445 {
446 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
447 }
448 if (this.getMeasProfValidDt() != null)
449 {
450 cmp = (cmp != 0 ? cmp : this.getMeasProfValidDt().compareTo(o.getMeasProfValidDt()));
451 }
452 if (this.getMeasProfQualifDt() != null)
453 {
454 cmp = (cmp != 0 ? cmp : this.getMeasProfQualifDt().compareTo(o.getMeasProfQualifDt()));
455 }
456 if (this.getMeasProfQualifCm() != null)
457 {
458 cmp = (cmp != 0 ? cmp : this.getMeasProfQualifCm().compareTo(o.getMeasProfQualifCm()));
459 }
460 }
461 return cmp;
462 }
463 // HibernateEntity.vsl merge-point
464 // MeasuredProfile.java merge-point
465 }