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