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