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.aquaculture;
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.QualityFlag;
31 import fr.ifremer.quadrige2.core.dao.referential.taxon.ReferenceTaxon;
32 import java.sql.Timestamp;
33 import java.util.Collection;
34 import java.util.Date;
35 import java.util.Set;
36 import org.andromda.spring.PaginationResult;
37
38 /**
39 * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
40 * paramètres sur une même population de mollusques répartis en lots sur le littoral français. Cela
41 * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de mollusques,
42 * que l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
43 * sur différents lieux de mesures.
44 * @see InitialPopulation
45 */
46 public interface InitialPopulationDao
47 {
48 /**
49 * This constant is used as a transformation flag; entities can be converted automatically into value objects
50 * or other types, different methods in a class implementing this interface support this feature: look for
51 * an <code>int</code> parameter called <code>transform</code>.
52 * <p>
53 * This specific flag denotes no transformation will occur.
54 */
55 public static final int TRANSFORM_NONE = 0;
56
57
58 /**
59 * Transforms the given results to a collection of {@link InitialPopulation}
60 * instances (this is useful when the returned results contains a row of data and you want just entities only).
61 *
62 * @param results the query results.
63 */
64 public void toEntities(final Collection<?> results);
65
66 /**
67 * Gets an instance of InitialPopulation from the persistent store.
68 * @param initPopId
69 * @return InitialPopulation
70 */
71 public InitialPopulation get(Integer initPopId);
72
73 /**
74 * <p>
75 * Does the same thing as {@link #get(Integer)} with an
76 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
77 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
78 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
79 * optionally transform the entity (into a value object for example). By default, transformation does
80 * not occur.
81 * </p>
82 *
83 * @param transform flag to determine transformation type.
84 * @param initPopId the identifier of the entity to get.
85 * @return either the entity or the object transformed from the entity.
86 */
87 public Object get(int transform, Integer initPopId);
88
89 /**
90 * Loads an instance of InitialPopulation from the persistent store.
91 * @param initPopId
92 * @return InitialPopulation
93 */
94 public InitialPopulation load(Integer initPopId);
95
96 /**
97 * <p>
98 * Does the same thing as {@link #load(Integer)} with an
99 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
100 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
101 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
102 * optionally transform the entity (into a value object for example). By default, transformation does
103 * not occur.
104 * </p>
105 *
106 * @param transform flag to determine transformation type.
107 * @param initPopId the identifier of the entity to load.
108 * @return either the entity or the object transformed from the entity.
109 */
110 public Object load(int transform, Integer initPopId);
111
112 /**
113 * Loads all entities of type {@link InitialPopulation}.
114 *
115 * @return the loaded entities.
116 */
117 public Collection<InitialPopulation> loadAll();
118
119 /**
120 * <p>
121 * Does the same thing as {@link #loadAll()} with an
122 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
123 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
124 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
125 * transform the entity (into a value object for example). By default, transformation does
126 * not occur.
127 * </p>
128 *
129 * @param transform the flag indicating what transformation to use.
130 * @return the loaded entities.
131 */
132 public Collection<?> loadAll(final int transform);
133
134 /**
135 * <p>
136 * Does the same thing as {@link #loadAll()} with an
137 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
138 * 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
139 * page retrieved.
140 * </p>
141 *
142 * @param pageNumber the page number to retrieve when paging results.
143 * @param pageSize the size of the page to retrieve when paging results.
144 * @return the loaded entities.
145 */
146 public Collection<?> loadAll(final int pageNumber, final int pageSize);
147
148 /**
149 * <p>
150 * Does the same thing as {@link #loadAll(int)} with an
151 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
152 * 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
153 * page retrieved.
154 * </p>
155 *
156 * @param transform the flag indicating what transformation to use.
157 * @param pageNumber the page number to retrieve when paging results.
158 * @param pageSize the size of the page to retrieve when paging results.
159 * @return the loaded entities.
160 */
161 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
162
163 /**
164 * Creates an instance of InitialPopulation and adds it to the persistent store.
165 * @param initialPopulation
166 * @return InitialPopulation
167 */
168 public InitialPopulation create(InitialPopulation initialPopulation);
169
170 /**
171 * <p>
172 * Does the same thing as {@link #create(InitialPopulation)} with an
173 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
174 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
175 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
176 * transform the entity (into a value object for example). By default, transformation does
177 * not occur.
178 * </p>
179 * @param transform
180 * @param initialPopulation
181 * @return Object
182 */
183 public Object create(int transform, InitialPopulation initialPopulation);
184
185 /**
186 * Creates a new instance of InitialPopulation and adds
187 * from the passed in <code>entities</code> collection
188 *
189 * @param entities the collection of InitialPopulation
190 * instances to create.
191 *
192 * @return the created instances.
193 */
194 public Collection<InitialPopulation> create(Collection<InitialPopulation> entities);
195
196 /**
197 * <p>
198 * Does the same thing as {@link #create(InitialPopulation)} with an
199 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
200 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
201 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
202 * transform the entities (into value objects for example). By default, transformation does
203 * not occur.
204 * </p>
205 * @param transform
206 * @param entities
207 * @return Collection
208 */
209 public Collection<?> create(int transform, Collection<InitialPopulation> entities);
210
211 /**
212 * <p>
213 * Creates a new <code>InitialPopulation</code>
214 * instance from <strong>all</strong> attributes and adds it to
215 * the persistent store.
216 * </p>
217 * @param initPopNm Libellé de la population initiale
218 * @param initPopLb Mnémonique de la population initiale
219 * @param initPopCm Commentaire sur la population initiale
220 * @param initPopQualifDt Date de qualification de la population initiale
221 * @param initPopQualifCm Commentaire de qualification de la population initiale
222 * @param initPopValidDt Date de validation de la population initiale
223 * @param initPopControlDt Date de controle de la population initiale
224 * @param initPopStartDt Date de mise à disposition de la population initiale
225 * @param initPopBiometricIndivNb Nombre d'individus pour les mesures de biométrie
226 * @param updateDt Date de maj
227 * @return InitialPopulation
228 */
229 public InitialPopulation create(
230 String initPopNm,
231 String initPopLb,
232 String initPopCm,
233 Date initPopQualifDt,
234 String initPopQualifCm,
235 Date initPopValidDt,
236 Date initPopControlDt,
237 Date initPopStartDt,
238 Double initPopBiometricIndivNb,
239 Timestamp updateDt);
240
241 /**
242 * <p>
243 * Does the same thing as {@link #create(String, String, String, Date, String, Date, Date, Date, Double, Timestamp)} with an
244 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
245 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
246 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
247 * transform the entity (into a value object for example). By default, transformation does
248 * not occur.
249 * </p>
250 * @param transform
251 * @param initPopNm Libellé de la population initiale
252 * @param initPopLb Mnémonique de la population initiale
253 * @param initPopCm Commentaire sur la population initiale
254 * @param initPopQualifDt Date de qualification de la population initiale
255 * @param initPopQualifCm Commentaire de qualification de la population initiale
256 * @param initPopValidDt Date de validation de la population initiale
257 * @param initPopControlDt Date de controle de la population initiale
258 * @param initPopStartDt Date de mise à disposition de la population initiale
259 * @param initPopBiometricIndivNb Nombre d'individus pour les mesures de biométrie
260 * @param updateDt Date de maj
261 * @return InitialPopulation
262 */
263 public Object create(
264 int transform,
265 String initPopNm,
266 String initPopLb,
267 String initPopCm,
268 Date initPopQualifDt,
269 String initPopQualifCm,
270 Date initPopValidDt,
271 Date initPopControlDt,
272 Date initPopStartDt,
273 Double initPopBiometricIndivNb,
274 Timestamp updateDt);
275
276 /**
277 * <p>
278 * Creates a new <code>InitialPopulation</code>
279 * instance from only <strong>required</strong> properties (attributes
280 * and association ends) and adds it to the persistent store.
281 * </p>
282 * @param initPopBiometricIndivNb
283 * @param initPopLb
284 * @param initPopNm
285 * @param initPopStartDt
286 * @param updateDt
287 * @param ageGroup
288 * @param qualityFlag
289 * @param referenceTaxon
290 * @return InitialPopulation
291 */
292 public InitialPopulation create(
293 Double initPopBiometricIndivNb,
294 String initPopLb,
295 String initPopNm,
296 Date initPopStartDt,
297 Timestamp updateDt,
298 AgeGroup ageGroup,
299 QualityFlag qualityFlag,
300 ReferenceTaxon referenceTaxon);
301
302 /**
303 * <p>
304 * Does the same thing as {@link #create(String, String, Date, Double, Timestamp)} with an
305 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
306 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
307 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
308 * transform the entity (into a value object for example). By default, transformation does
309 * not occur.
310 * </p>
311 * @param transform flag to determine transformation type.
312 * @param initPopBiometricIndivNb
313 * @param initPopLb
314 * @param initPopNm
315 * @param initPopStartDt
316 * @param updateDt
317 * @param ageGroup
318 * @param qualityFlag
319 * @param referenceTaxon
320 * @return Object
321 */
322 public Object create(
323 int transform,
324 Double initPopBiometricIndivNb,
325 String initPopLb,
326 String initPopNm,
327 Date initPopStartDt,
328 Timestamp updateDt,
329 AgeGroup ageGroup,
330 QualityFlag qualityFlag,
331 ReferenceTaxon referenceTaxon);
332
333 /**
334 * Updates the <code>initialPopulation</code> instance in the persistent store.
335 * @param initialPopulation
336 */
337 public void update(InitialPopulation initialPopulation);
338
339 /**
340 * Updates all instances in the <code>entities</code> collection in the persistent store.
341 * @param entities
342 */
343 public void update(Collection<InitialPopulation> entities);
344
345 /**
346 * Removes the instance of InitialPopulation from the persistent store.
347 * @param initialPopulation
348 */
349 public void remove(InitialPopulation initialPopulation);
350
351 /**
352 * Removes the instance of InitialPopulation having the given
353 * <code>identifier</code> from the persistent store.
354 * @param initPopId
355 */
356 public void remove(Integer initPopId);
357
358 /**
359 * Removes all entities in the given <code>entities</code> collection.
360 * @param entities
361 */
362 public void remove(Collection<InitialPopulation> entities);
363
364
365 /**
366 * Does the same thing as {@link #search(int, Search)} but with an
367 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
368 * limit your data to a specified page number and size.
369 *
370 * @param transform the transformation flag.
371 * @param pageNumber the page number in the data to retrieve
372 * @param pageSize the size of the page to retrieve.
373 * @param search the search object which provides the search parameters and pagination specification.
374 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
375 */
376 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
377
378 /**
379 * Does the same thing as {@link #search(Search)} but with an
380 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
381 * limit your data to a specified page number and size.
382 *
383 * @param pageNumber the page number in the data to retrieve
384 * @param pageSize the size of the page to retrieve.
385 * @param search the search object which provides the search parameters and pagination specification.
386 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
387 */
388 public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
389
390 /**
391 * Does the same thing as {@link #search(Search)} but with an
392 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
393 * finder results will <strong>NOT</strong> be transformed during retrieval.
394 * If this flag is any of the other constants defined here
395 * then results <strong>WILL BE</strong> passed through an operation which can optionally
396 * transform the entities (into value objects for example). By default, transformation does
397 * not occur.
398 *
399 * @param transform the transformation flag.
400 * @param search the search object which provides the search parameters and pagination specification.
401 * @return any found results from the search.
402 */
403 public Set<?> search(final int transform, final Search search);
404
405 /**
406 * Performs a search using the parameters specified in the given <code>search</code> object.
407 *
408 * @param search the search object which provides the search parameters and pagination specification.
409 * @return any found results from the search.
410 */
411 public Set<InitialPopulation> search(final Search search);
412
413 /**
414 * Allows transformation of entities into value objects
415 * (or something else for that matter), when the <code>transform</code>
416 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige2.core.dao.data.aquaculture.InitialPopulationDao</code>, please note
417 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
418 * will be returned.
419 *
420 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
421 *
422 * @param transform one of the constants declared in {@link fr.ifremer.quadrige2.core.dao.data.aquaculture.InitialPopulationDao}
423 * @param entity an entity that was found
424 * @return the transformed entity (i.e. new value object, etc)
425 * @see #transformEntities(int,Collection)
426 */
427 public Object transformEntity(final int transform, final InitialPopulation entity);
428
429 /**
430 * Transforms a collection of entities using the
431 * {@link #transformEntity(int,InitialPopulation)}
432 * method. This method does not instantiate a new collection.
433 * <p>
434 * This method is to be used internally only.
435 *
436 * @param transform one of the constants declared in <code>fr.ifremer.quadrige2.core.dao.data.aquaculture.InitialPopulationDao</code>
437 * @param entities the collection of entities to transform
438 * @see #transformEntity(int,InitialPopulation)
439 */
440 public void transformEntities(final int transform, final Collection<?> entities);
441
442 // spring-dao merge-point
443 }