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.administration.strategy;
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.referential.AcquisitionLevel;
29 import fr.ifremer.quadrige3.core.dao.referential.PrecisionType;
30 import fr.ifremer.quadrige3.core.dao.referential.pmfm.Pmfm;
31 import java.io.Serializable;
32 import java.sql.Timestamp;
33 import java.util.Collection;
34 import java.util.HashSet;
35
36 /**
37 * PSFM associés à une stratégie
38 * PMSF associés à une stratégie.
39 */
40 // HibernateEntity.vsl annotations merge-point
41 public abstract class PmfmStrategy
42 implements Serializable, Comparable<PmfmStrategy>
43 {
44 /**
45 * The serial version UID of this class. Needed for serialization.
46 */
47 private static final long serialVersionUID = -7292735489981839539L;
48
49 // Generate 6 attributes
50 private Integer pmfmStratId;
51
52 /**
53 *
54 * @return this.pmfmStratId Integer
55 */
56 public Integer getPmfmStratId()
57 {
58 return this.pmfmStratId;
59 }
60
61 /**
62 *
63 * @param pmfmStratIdIn Integer
64 */
65 public void setPmfmStratId(Integer pmfmStratIdIn)
66 {
67 this.pmfmStratId = pmfmStratIdIn;
68 }
69
70 private Integer pmfmStratParAcquisNumber;
71
72 /**
73 * Nombre de fois où un paramètre peut être saisi
74 * Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la
75 * valeur 1
76 * @return this.pmfmStratParAcquisNumber Integer
77 */
78 public Integer getPmfmStratParAcquisNumber()
79 {
80 return this.pmfmStratParAcquisNumber;
81 }
82
83 /**
84 * Nombre de fois où un paramètre peut être saisi
85 * Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la
86 * valeur 1
87 * @param pmfmStratParAcquisNumberIn Integer
88 */
89 public void setPmfmStratParAcquisNumber(Integer pmfmStratParAcquisNumberIn)
90 {
91 this.pmfmStratParAcquisNumber = pmfmStratParAcquisNumberIn;
92 }
93
94 private Integer pmfmStratPresRk;
95
96 /**
97 * Rang pour la presentation des résultats
98 * @return this.pmfmStratPresRk Integer
99 */
100 public Integer getPmfmStratPresRk()
101 {
102 return this.pmfmStratPresRk;
103 }
104
105 /**
106 * Rang pour la presentation des résultats
107 * @param pmfmStratPresRkIn Integer
108 */
109 public void setPmfmStratPresRk(Integer pmfmStratPresRkIn)
110 {
111 this.pmfmStratPresRk = pmfmStratPresRkIn;
112 }
113
114 private String pmfmStratParIsIndiv;
115
116 /**
117 * Indique si la saisie du paramètre se fait sur des individus
118 * @return this.pmfmStratParIsIndiv String
119 */
120 public String getPmfmStratParIsIndiv()
121 {
122 return this.pmfmStratParIsIndiv;
123 }
124
125 /**
126 * Indique si la saisie du paramètre se fait sur des individus
127 * @param pmfmStratParIsIndivIn String
128 */
129 public void setPmfmStratParIsIndiv(String pmfmStratParIsIndivIn)
130 {
131 this.pmfmStratParIsIndiv = pmfmStratParIsIndivIn;
132 }
133
134 private String pmfmStratIsUniqueByTaxon;
135
136 /**
137 *
138 * @return this.pmfmStratIsUniqueByTaxon String
139 */
140 public String getPmfmStratIsUniqueByTaxon()
141 {
142 return this.pmfmStratIsUniqueByTaxon;
143 }
144
145 /**
146 *
147 * @param pmfmStratIsUniqueByTaxonIn String
148 */
149 public void setPmfmStratIsUniqueByTaxon(String pmfmStratIsUniqueByTaxonIn)
150 {
151 this.pmfmStratIsUniqueByTaxon = pmfmStratIsUniqueByTaxonIn;
152 }
153
154 private Timestamp updateDt;
155
156 /**
157 * Date de modification de l'objet, mise à jour par le système
158 * @return this.updateDt Timestamp
159 */
160 public Timestamp getUpdateDt()
161 {
162 return this.updateDt;
163 }
164
165 /**
166 * Date de modification de l'objet, mise à jour par le système
167 * @param updateDtIn Timestamp
168 */
169 public void setUpdateDt(Timestamp updateDtIn)
170 {
171 this.updateDt = updateDtIn;
172 }
173
174 // Generate 6 associations
175 private Collection<UiFunction> uiFunctions = new HashSet<UiFunction>();
176
177 /**
178 * Fonction de calcul affichées lors de la saisie en mode colonne.
179 * Permet de fournir un calcul sur une série de mesure.
180 * Ces calculs ne sont pas stockés et sont là uniquement pour un contrôle lors de la saisie
181 * @return this.uiFunctions Collection<UiFunction>
182 */
183 public Collection<UiFunction> getUiFunctions()
184 {
185 return this.uiFunctions;
186 }
187
188 /**
189 * Fonction de calcul affichées lors de la saisie en mode colonne.
190 * Permet de fournir un calcul sur une série de mesure.
191 * Ces calculs ne sont pas stockés et sont là uniquement pour un contrôle lors de la saisie
192 * @param uiFunctionsIn Collection<UiFunction>
193 */
194 public void setUiFunctions(Collection<UiFunction> uiFunctionsIn)
195 {
196 this.uiFunctions = uiFunctionsIn;
197 }
198
199 /**
200 * Fonction de calcul affichées lors de la saisie en mode colonne.
201 * Permet de fournir un calcul sur une série de mesure.
202 * Ces calculs ne sont pas stockés et sont là uniquement pour un contrôle lors de la saisie
203 * @param elementToAdd UiFunction
204 * @return <tt>true</tt> if this collection changed as a result of the
205 * call
206 */
207 public boolean addUiFunctions(UiFunction elementToAdd)
208 {
209 return this.uiFunctions.add(elementToAdd);
210 }
211
212 /**
213 * Fonction de calcul affichées lors de la saisie en mode colonne.
214 * Permet de fournir un calcul sur une série de mesure.
215 * Ces calculs ne sont pas stockés et sont là uniquement pour un contrôle lors de la saisie
216 * @param elementToRemove UiFunction
217 * @return <tt>true</tt> if this collection changed as a result of the
218 * call
219 */
220 public boolean removeUiFunctions(UiFunction elementToRemove)
221 {
222 return this.uiFunctions.remove(elementToRemove);
223 }
224
225 private Pmfm pmfm;
226
227 /**
228 * Liste les quadruplets paramètre, méthode, support, fraction.
229 * @return this.pmfm Pmfm
230 */
231 public Pmfm getPmfm()
232 {
233 return this.pmfm;
234 }
235
236 /**
237 * Liste les quadruplets paramètre, méthode, support, fraction.
238 * @param pmfmIn Pmfm
239 */
240 public void setPmfm(Pmfm pmfmIn)
241 {
242 this.pmfm = pmfmIn;
243 }
244
245 private PrecisionType precisionType;
246
247 /**
248 * type d'incertitude des mesures d'un paramètre dans une stratégie.
249 * @return this.precisionType PrecisionType
250 */
251 public PrecisionType getPrecisionType()
252 {
253 return this.precisionType;
254 }
255
256 /**
257 * type d'incertitude des mesures d'un paramètre dans une stratégie.
258 * @param precisionTypeIn PrecisionType
259 */
260 public void setPrecisionType(PrecisionType precisionTypeIn)
261 {
262 this.precisionType = precisionTypeIn;
263 }
264
265 private Strategy strategy;
266
267 /**
268 * Définie les paramètres à mesurer dans un programme particulier.
269 * @return this.strategy Strategy
270 */
271 public Strategy getStrategy()
272 {
273 return this.strategy;
274 }
275
276 /**
277 * Définie les paramètres à mesurer dans un programme particulier.
278 * @param strategyIn Strategy
279 */
280 public void setStrategy(Strategy strategyIn)
281 {
282 this.strategy = strategyIn;
283 }
284
285 private Collection<AcquisitionLevel> acquisitionLevels = new HashSet<AcquisitionLevel>();
286
287 /**
288 * Liste les différents niveau de saisie des résultats (Passage, Prélèvement, échantillon).
289 * @return this.acquisitionLevels Collection<AcquisitionLevel>
290 */
291 public Collection<AcquisitionLevel> getAcquisitionLevels()
292 {
293 return this.acquisitionLevels;
294 }
295
296 /**
297 * Liste les différents niveau de saisie des résultats (Passage, Prélèvement, échantillon).
298 * @param acquisitionLevelsIn Collection<AcquisitionLevel>
299 */
300 public void setAcquisitionLevels(Collection<AcquisitionLevel> acquisitionLevelsIn)
301 {
302 this.acquisitionLevels = acquisitionLevelsIn;
303 }
304
305 /**
306 * Liste les différents niveau de saisie des résultats (Passage, Prélèvement, échantillon).
307 * @param elementToAdd AcquisitionLevel
308 * @return <tt>true</tt> if this collection changed as a result of the
309 * call
310 */
311 public boolean addAcquisitionLevels(AcquisitionLevel elementToAdd)
312 {
313 return this.acquisitionLevels.add(elementToAdd);
314 }
315
316 /**
317 * Liste les différents niveau de saisie des résultats (Passage, Prélèvement, échantillon).
318 * @param elementToRemove AcquisitionLevel
319 * @return <tt>true</tt> if this collection changed as a result of the
320 * call
321 */
322 public boolean removeAcquisitionLevels(AcquisitionLevel elementToRemove)
323 {
324 return this.acquisitionLevels.remove(elementToRemove);
325 }
326
327 /**
328 * Returns <code>true</code> if the argument is an PmfmStrategy instance and all identifiers for this entity
329 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
330 */
331 @Override
332 public boolean equals(Object object)
333 {
334 if (this == object)
335 {
336 return true;
337 }
338 if (!(object instanceof PmfmStrategy))
339 {
340 return false;
341 }
342 final PmfmStrategy that = (PmfmStrategy)object;
343 if (this.pmfmStratId == null || that.getPmfmStratId() == null || !this.pmfmStratId.equals(that.getPmfmStratId()))
344 {
345 return false;
346 }
347 return true;
348 }
349
350 /**
351 * Returns a hash code based on this entity's identifiers.
352 */
353 @Override
354 public int hashCode()
355 {
356 int hashCode = 0;
357 hashCode = 29 * hashCode + (this.pmfmStratId == null ? 0 : this.pmfmStratId.hashCode());
358
359 return hashCode;
360 }
361
362 /**
363 * Constructs new instances of {@link PmfmStrategy}.
364 */
365 public static final class Factory
366 {
367 /**
368 * Constructs a new instance of {@link PmfmStrategy}.
369 * @return new PmfmStrategyImpl()
370 */
371 public static PmfmStrategy newInstance()
372 {
373 return new PmfmStrategyImpl();
374 }
375
376 /**
377 * Constructs a new instance of {@link PmfmStrategy}, taking all required and/or
378 * read-only properties as arguments, except for identifiers.
379 * @param pmfmStratParAcquisNumber Integer
380 * @param pmfm Pmfm
381 * @param strategy Strategy
382 * @return newInstance
383 */
384 public static PmfmStrategy newInstance(Integer pmfmStratParAcquisNumber, Pmfm pmfm, Strategy strategy)
385 {
386 final PmfmStrategy entity = new PmfmStrategyImpl();
387 entity.setPmfmStratParAcquisNumber(pmfmStratParAcquisNumber);
388 entity.setPmfm(pmfm);
389 entity.setStrategy(strategy);
390 return entity;
391 }
392
393 /**
394 * Constructs a new instance of {@link PmfmStrategy}, taking all possible properties
395 * (except the identifier(s))as arguments.
396 * @param pmfmStratParAcquisNumber Integer
397 * @param pmfmStratPresRk Integer
398 * @param pmfmStratParIsIndiv String
399 * @param pmfmStratIsUniqueByTaxon String
400 * @param updateDt Timestamp
401 * @param uiFunctions Collection<UiFunction>
402 * @param pmfm Pmfm
403 * @param precisionType PrecisionType
404 * @param strategy Strategy
405 * @param acquisitionLevels Collection<AcquisitionLevel>
406 * @return newInstance PmfmStrategy
407 */
408 public static PmfmStrategy newInstance(Integer pmfmStratParAcquisNumber, Integer pmfmStratPresRk, String pmfmStratParIsIndiv, String pmfmStratIsUniqueByTaxon, Timestamp updateDt, Collection<UiFunction> uiFunctions, Pmfm pmfm, PrecisionType precisionType, Strategy strategy, Collection<AcquisitionLevel> acquisitionLevels)
409 {
410 final PmfmStrategy entity = new PmfmStrategyImpl();
411 entity.setPmfmStratParAcquisNumber(pmfmStratParAcquisNumber);
412 entity.setPmfmStratPresRk(pmfmStratPresRk);
413 entity.setPmfmStratParIsIndiv(pmfmStratParIsIndiv);
414 entity.setPmfmStratIsUniqueByTaxon(pmfmStratIsUniqueByTaxon);
415 entity.setUpdateDt(updateDt);
416 entity.setUiFunctions(uiFunctions);
417 entity.setPmfm(pmfm);
418 entity.setPrecisionType(precisionType);
419 entity.setStrategy(strategy);
420 entity.setAcquisitionLevels(acquisitionLevels);
421 return entity;
422 }
423 }
424
425 /**
426 * @see Comparable#compareTo
427 */
428 public int compareTo(PmfmStrategy o)
429 {
430 int cmp = 0;
431 if (this.getPmfmStratId() != null)
432 {
433 cmp = this.getPmfmStratId().compareTo(o.getPmfmStratId());
434 }
435 else
436 {
437 if (this.getPmfmStratParAcquisNumber() != null)
438 {
439 cmp = (cmp != 0 ? cmp : this.getPmfmStratParAcquisNumber().compareTo(o.getPmfmStratParAcquisNumber()));
440 }
441 if (this.getPmfmStratPresRk() != null)
442 {
443 cmp = (cmp != 0 ? cmp : this.getPmfmStratPresRk().compareTo(o.getPmfmStratPresRk()));
444 }
445 if (this.getPmfmStratParIsIndiv() != null)
446 {
447 cmp = (cmp != 0 ? cmp : this.getPmfmStratParIsIndiv().compareTo(o.getPmfmStratParIsIndiv()));
448 }
449 if (this.getPmfmStratIsUniqueByTaxon() != null)
450 {
451 cmp = (cmp != 0 ? cmp : this.getPmfmStratIsUniqueByTaxon().compareTo(o.getPmfmStratIsUniqueByTaxon()));
452 }
453 if (this.getUpdateDt() != null)
454 {
455 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
456 }
457 }
458 return cmp;
459 }
460 // HibernateEntity.vsl merge-point
461 // PmfmStrategy.java merge-point
462 }