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