1 // license-header java merge-point
2 //
3 // Attention: Generated code! Do not modify by hand!
4 // Generated by: SpringDao.vsl in andromda-spring-cartridge.
5 //
6 package fr.ifremer.quadrige2.core.dao.data.measurement;
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.Search;
30 import fr.ifremer.quadrige2.core.dao.referential.ObjectType;
31 import fr.ifremer.quadrige2.core.dao.referential.QualityFlag;
32 import fr.ifremer.quadrige2.core.dao.referential.pmfm.Pmfm;
33 import java.sql.Timestamp;
34 import java.util.Collection;
35 import java.util.Date;
36 import java.util.Set;
37 import org.andromda.spring.PaginationResult;
38
39 /**
40 * Résultat de mesure faisant l'objet d'une mesure unique pour un taxon, ou un regroupement de taxon
41 * particulier.
42 * @see TaxonMeasurement
43 */
44 public interface TaxonMeasurementDao
45 {
46 /**
47 * This constant is used as a transformation flag; entities can be converted automatically into value objects
48 * or other types, different methods in a class implementing this interface support this feature: look for
49 * an <code>int</code> parameter called <code>transform</code>.
50 * <p>
51 * This specific flag denotes no transformation will occur.
52 */
53 public static final int TRANSFORM_NONE = 0;
54
55
56 /**
57 * Transforms the given results to a collection of {@link TaxonMeasurement}
58 * instances (this is useful when the returned results contains a row of data and you want just entities only).
59 *
60 * @param results the query results.
61 */
62 public void toEntities(final Collection<?> results);
63
64 /**
65 * Gets an instance of TaxonMeasurement from the persistent store.
66 * @param taxonMeasId
67 * @return TaxonMeasurement
68 */
69 public TaxonMeasurement get(Integer taxonMeasId);
70
71 /**
72 * <p>
73 * Does the same thing as {@link #get(Integer)} with an
74 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
75 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
76 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
77 * optionally transform the entity (into a value object for example). By default, transformation does
78 * not occur.
79 * </p>
80 *
81 * @param transform flag to determine transformation type.
82 * @param taxonMeasId the identifier of the entity to get.
83 * @return either the entity or the object transformed from the entity.
84 */
85 public Object get(int transform, Integer taxonMeasId);
86
87 /**
88 * Loads an instance of TaxonMeasurement from the persistent store.
89 * @param taxonMeasId
90 * @return TaxonMeasurement
91 */
92 public TaxonMeasurement load(Integer taxonMeasId);
93
94 /**
95 * <p>
96 * Does the same thing as {@link #load(Integer)} with an
97 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
98 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
99 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
100 * optionally transform the entity (into a value object for example). By default, transformation does
101 * not occur.
102 * </p>
103 *
104 * @param transform flag to determine transformation type.
105 * @param taxonMeasId the identifier of the entity to load.
106 * @return either the entity or the object transformed from the entity.
107 */
108 public Object load(int transform, Integer taxonMeasId);
109
110 /**
111 * Loads all entities of type {@link TaxonMeasurement}.
112 *
113 * @return the loaded entities.
114 */
115 public Collection<TaxonMeasurement> loadAll();
116
117 /**
118 * <p>
119 * Does the same thing as {@link #loadAll()} with an
120 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
121 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
122 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
123 * transform the entity (into a value object for example). By default, transformation does
124 * not occur.
125 * </p>
126 *
127 * @param transform the flag indicating what transformation to use.
128 * @return the loaded entities.
129 */
130 public Collection<?> loadAll(final int transform);
131
132 /**
133 * <p>
134 * Does the same thing as {@link #loadAll()} with an
135 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
136 * argument allows you to specify the page number when you are paging the results and the pageSize allows you to specify the size of the
137 * page retrieved.
138 * </p>
139 *
140 * @param pageNumber the page number to retrieve when paging results.
141 * @param pageSize the size of the page to retrieve when paging results.
142 * @return the loaded entities.
143 */
144 public Collection<?> loadAll(final int pageNumber, final int pageSize);
145
146 /**
147 * <p>
148 * Does the same thing as {@link #loadAll(int)} with an
149 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
150 * argument allows you to specify the page number when you are paging the results and the pageSize allows you to specify the size of the
151 * page retrieved.
152 * </p>
153 *
154 * @param transform the flag indicating what transformation to use.
155 * @param pageNumber the page number to retrieve when paging results.
156 * @param pageSize the size of the page to retrieve when paging results.
157 * @return the loaded entities.
158 */
159 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
160
161 /**
162 * Creates an instance of TaxonMeasurement and adds it to the persistent store.
163 * @param taxonMeasurement
164 * @return TaxonMeasurement
165 */
166 public TaxonMeasurement create(TaxonMeasurement taxonMeasurement);
167
168 /**
169 * <p>
170 * Does the same thing as {@link #create(TaxonMeasurement)} with an
171 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
172 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
173 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
174 * transform the entity (into a value object for example). By default, transformation does
175 * not occur.
176 * </p>
177 * @param transform
178 * @param taxonMeasurement
179 * @return Object
180 */
181 public Object create(int transform, TaxonMeasurement taxonMeasurement);
182
183 /**
184 * Creates a new instance of TaxonMeasurement and adds
185 * from the passed in <code>entities</code> collection
186 *
187 * @param entities the collection of TaxonMeasurement
188 * instances to create.
189 *
190 * @return the created instances.
191 */
192 public Collection<TaxonMeasurement> create(Collection<TaxonMeasurement> entities);
193
194 /**
195 * <p>
196 * Does the same thing as {@link #create(TaxonMeasurement)} with an
197 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
198 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
199 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
200 * transform the entities (into value objects for example). By default, transformation does
201 * not occur.
202 * </p>
203 * @param transform
204 * @param entities
205 * @return Collection
206 */
207 public Collection<?> create(int transform, Collection<TaxonMeasurement> entities);
208
209 /**
210 * <p>
211 * Creates a new <code>TaxonMeasurement</code>
212 * instance from <strong>all</strong> attributes and adds it to
213 * the persistent store.
214 * </p>
215 * @param objectId Identifiant interne de donnnée in situ de référence (passage, prélèvement, prélèvement)
216 * @param taxonMeasIndivId Le numéro de l'individu mesuré pour les résultats sur taxon ayant plusieurs individus
217 * @param taxonMeasNumerValue La valeur du résultat si elle n'est pas qualitative
218 * @param taxonMeasPrecisionValue La valeur de l'incertitude. Ex : 2 (%) ou 0,01 (dégrés)
219 * @param taxonMeasDigitNumber Nombre de chiffre après la virgule du résulat. Ex : si on saisit 10.00, il faut conserver 2 comme
220 information
221 * @param taxonMeasControlDt Date de contrôle
222 * @param taxonMeasValidDt Date de validation
223 * @param taxonMeasQualifDt Date de la qualification du résultat
224 * @param taxonMeasQualifCm Commentaire sur la qualification du résultat
225 Un commentaire de qualification est obligatoire si la mesure est douteuse ou mauvaise.
226 * @param taxonMeasCm Commentaire sur le résultat sur taxon
227 * @param updateDt Date de modification de l'objet, mise à jour par le système
228 * @param parCd @deprecated (filled by synchro)
229 * @param matrixId @deprecated (filled by synchro)
230 * @param fractionId @deprecated (filled by synchro)
231 * @param methodId @deprecated (filled by synchro)
232 * @param taxonNameId Identifiant interne du taxon cité (Utilisé par BD Recif pour stocker l'identifiant du taxon saisi
233 par l'utilisateur)
234 * @param taxonNameNm Nom scientifique du taxon cité (Utilisé par BD Recif pour stocker le libellé du taxon saisi par
235 l'utilisateur)
236 * @return TaxonMeasurement
237 */
238 public TaxonMeasurement create(
239 Integer objectId,
240 Integer taxonMeasIndivId,
241 Float taxonMeasNumerValue,
242 Float taxonMeasPrecisionValue,
243 Double taxonMeasDigitNumber,
244 Date taxonMeasControlDt,
245 Date taxonMeasValidDt,
246 Date taxonMeasQualifDt,
247 String taxonMeasQualifCm,
248 String taxonMeasCm,
249 Timestamp updateDt,
250 String parCd,
251 Integer matrixId,
252 Integer fractionId,
253 Integer methodId,
254 Integer taxonNameId,
255 String taxonNameNm);
256
257 /**
258 * <p>
259 * Does the same thing as {@link #create(Integer, Integer, Float, Float, Double, Date, Date, Date, String, String, Timestamp, String, Integer, Integer, Integer, Integer, String)} with an
260 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
261 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
262 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
263 * transform the entity (into a value object for example). By default, transformation does
264 * not occur.
265 * </p>
266 * @param transform
267 * @param objectId Identifiant interne de donnnée in situ de référence (passage, prélèvement, prélèvement)
268 * @param taxonMeasIndivId Le numéro de l'individu mesuré pour les résultats sur taxon ayant plusieurs individus
269 * @param taxonMeasNumerValue La valeur du résultat si elle n'est pas qualitative
270 * @param taxonMeasPrecisionValue La valeur de l'incertitude. Ex : 2 (%) ou 0,01 (dégrés)
271 * @param taxonMeasDigitNumber Nombre de chiffre après la virgule du résulat. Ex : si on saisit 10.00, il faut conserver 2 comme
272 information
273 * @param taxonMeasControlDt Date de contrôle
274 * @param taxonMeasValidDt Date de validation
275 * @param taxonMeasQualifDt Date de la qualification du résultat
276 * @param taxonMeasQualifCm Commentaire sur la qualification du résultat
277 Un commentaire de qualification est obligatoire si la mesure est douteuse ou mauvaise.
278 * @param taxonMeasCm Commentaire sur le résultat sur taxon
279 * @param updateDt Date de modification de l'objet, mise à jour par le système
280 * @param parCd @deprecated (filled by synchro)
281 * @param matrixId @deprecated (filled by synchro)
282 * @param fractionId @deprecated (filled by synchro)
283 * @param methodId @deprecated (filled by synchro)
284 * @param taxonNameId Identifiant interne du taxon cité (Utilisé par BD Recif pour stocker l'identifiant du taxon saisi
285 par l'utilisateur)
286 * @param taxonNameNm Nom scientifique du taxon cité (Utilisé par BD Recif pour stocker le libellé du taxon saisi par
287 l'utilisateur)
288 * @return TaxonMeasurement
289 */
290 public Object create(
291 int transform,
292 Integer objectId,
293 Integer taxonMeasIndivId,
294 Float taxonMeasNumerValue,
295 Float taxonMeasPrecisionValue,
296 Double taxonMeasDigitNumber,
297 Date taxonMeasControlDt,
298 Date taxonMeasValidDt,
299 Date taxonMeasQualifDt,
300 String taxonMeasQualifCm,
301 String taxonMeasCm,
302 Timestamp updateDt,
303 String parCd,
304 Integer matrixId,
305 Integer fractionId,
306 Integer methodId,
307 Integer taxonNameId,
308 String taxonNameNm);
309
310 /**
311 * <p>
312 * Creates a new <code>TaxonMeasurement</code>
313 * instance from only <strong>required</strong> properties (attributes
314 * and association ends) and adds it to the persistent store.
315 * </p>
316 * @param objectId
317 * @param updateDt
318 * @param objectType
319 * @param pmfm
320 * @param qualityFlag
321 * @return TaxonMeasurement
322 */
323 public TaxonMeasurement create(
324 Integer objectId,
325 Timestamp updateDt,
326 ObjectType objectType,
327 Pmfm pmfm,
328 QualityFlag qualityFlag);
329
330 /**
331 * <p>
332 * Does the same thing as {@link #create(Integer, Timestamp)} with an
333 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
334 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
335 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
336 * transform the entity (into a value object for example). By default, transformation does
337 * not occur.
338 * </p>
339 * @param transform flag to determine transformation type.
340 * @param objectId
341 * @param updateDt
342 * @param objectType
343 * @param pmfm
344 * @param qualityFlag
345 * @return Object
346 */
347 public Object create(
348 int transform,
349 Integer objectId,
350 Timestamp updateDt,
351 ObjectType objectType,
352 Pmfm pmfm,
353 QualityFlag qualityFlag);
354
355 /**
356 * Updates the <code>taxonMeasurement</code> instance in the persistent store.
357 * @param taxonMeasurement
358 */
359 public void update(TaxonMeasurement taxonMeasurement);
360
361 /**
362 * Updates all instances in the <code>entities</code> collection in the persistent store.
363 * @param entities
364 */
365 public void update(Collection<TaxonMeasurement> entities);
366
367 /**
368 * Removes the instance of TaxonMeasurement from the persistent store.
369 * @param taxonMeasurement
370 */
371 public void remove(TaxonMeasurement taxonMeasurement);
372
373 /**
374 * Removes the instance of TaxonMeasurement having the given
375 * <code>identifier</code> from the persistent store.
376 * @param taxonMeasId
377 */
378 public void remove(Integer taxonMeasId);
379
380 /**
381 * Removes all entities in the given <code>entities</code> collection.
382 * @param entities
383 */
384 public void remove(Collection<TaxonMeasurement> entities);
385
386
387 /**
388 * Does the same thing as {@link #search(int, Search)} but with an
389 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
390 * limit your data to a specified page number and size.
391 *
392 * @param transform the transformation flag.
393 * @param pageNumber the page number in the data to retrieve
394 * @param pageSize the size of the page to retrieve.
395 * @param search the search object which provides the search parameters and pagination specification.
396 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
397 */
398 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
399
400 /**
401 * Does the same thing as {@link #search(Search)} but with an
402 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
403 * limit your data to a specified page number and size.
404 *
405 * @param pageNumber the page number in the data to retrieve
406 * @param pageSize the size of the page to retrieve.
407 * @param search the search object which provides the search parameters and pagination specification.
408 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
409 */
410 public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
411
412 /**
413 * Does the same thing as {@link #search(Search)} but with an
414 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
415 * finder results will <strong>NOT</strong> be transformed during retrieval.
416 * If this flag is any of the other constants defined here
417 * then results <strong>WILL BE</strong> passed through an operation which can optionally
418 * transform the entities (into value objects for example). By default, transformation does
419 * not occur.
420 *
421 * @param transform the transformation flag.
422 * @param search the search object which provides the search parameters and pagination specification.
423 * @return any found results from the search.
424 */
425 public Set<?> search(final int transform, final Search search);
426
427 /**
428 * Performs a search using the parameters specified in the given <code>search</code> object.
429 *
430 * @param search the search object which provides the search parameters and pagination specification.
431 * @return any found results from the search.
432 */
433 public Set<TaxonMeasurement> search(final Search search);
434
435 /**
436 * Allows transformation of entities into value objects
437 * (or something else for that matter), when the <code>transform</code>
438 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige2.core.dao.data.measurement.TaxonMeasurementDao</code>, please note
439 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
440 * will be returned.
441 *
442 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
443 *
444 * @param transform one of the constants declared in {@link fr.ifremer.quadrige2.core.dao.data.measurement.TaxonMeasurementDao}
445 * @param entity an entity that was found
446 * @return the transformed entity (i.e. new value object, etc)
447 * @see #transformEntities(int,Collection)
448 */
449 public Object transformEntity(final int transform, final TaxonMeasurement entity);
450
451 /**
452 * Transforms a collection of entities using the
453 * {@link #transformEntity(int,TaxonMeasurement)}
454 * method. This method does not instantiate a new collection.
455 * <p>
456 * This method is to be used internally only.
457 *
458 * @param transform one of the constants declared in <code>fr.ifremer.quadrige2.core.dao.data.measurement.TaxonMeasurementDao</code>
459 * @param entities the collection of entities to transform
460 * @see #transformEntity(int,TaxonMeasurement)
461 */
462 public void transformEntities(final int transform, final Collection<?> entities);
463
464 // spring-dao merge-point
465 }