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.quadrige3.core.dao.data.aquaculture;
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.Search;
29 import fr.ifremer.quadrige3.core.dao.referential.QualityFlag;
30 import fr.ifremer.quadrige3.core.dao.referential.monitoringLocation.MonitoringLocation;
31 import java.sql.Timestamp;
32 import java.util.Collection;
33 import java.util.Date;
34 import java.util.Set;
35 import org.andromda.spring.PaginationResult;
36
37 /**
38 * Un lot est un groupe d'animaux issu d'une même population initiale et suivi sur un même point
39 * dans des conditions d'élevage similaires (conditions expérimentales). Un lot est défini par : *
40 * une population initiale * un lieu de surveillance * des caractéristiques d'élevage (système +
41 * structure) * un niveau Ce lot de mollusques est positionné sur le terrain.
42 * @see Batch
43 */
44 public interface BatchDao
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 Batch}
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 Batch from the persistent store.
66 * @param batchId
67 * @return Batch
68 */
69 public Batch get(Integer batchId);
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 batchId 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 batchId);
86
87 /**
88 * Loads an instance of Batch from the persistent store.
89 * @param batchId
90 * @return Batch
91 */
92 public Batch load(Integer batchId);
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 batchId 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 batchId);
109
110 /**
111 * Loads all entities of type {@link Batch}.
112 *
113 * @return the loaded entities.
114 */
115 public Collection<Batch> 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 Batch and adds it to the persistent store.
163 * @param batch
164 * @return Batch
165 */
166 public Batch create(Batch batch);
167
168 /**
169 * <p>
170 * Does the same thing as {@link #create(Batch)} 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 batch
179 * @return Object
180 */
181 public Object create(int transform, Batch batch);
182
183 /**
184 * Creates a new instance of Batch and adds
185 * from the passed in <code>entities</code> collection
186 *
187 * @param entities the collection of Batch
188 * instances to create.
189 *
190 * @return the created instances.
191 */
192 public Collection<Batch> create(Collection<Batch> entities);
193
194 /**
195 * <p>
196 * Does the same thing as {@link #create(Batch)} 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<Batch> entities);
208
209 /**
210 * <p>
211 * Creates a new <code>Batch</code>
212 * instance from <strong>all</strong> attributes and adds it to
213 * the persistent store.
214 * </p>
215 * @param batchNm Libellé du lot
216 * @param batchLb Mnémonique du lot
217 * @param batchExperCond Conditions d'expérimentation
218 * @param batchBreedingStructurUnit Nombre d'occurences de la structure d'élevage
219 * @param batchBreedingSystemUnit Nombre d'occurences du système d'élevage
220 * @param batchCm Commentaire sur le lot
221 * @param batchControlDt Date de contrôle du lot
222 * @param batchValidDt Date de validation du lot
223 * @param batchQualifDt Date de qualification du lot
224 * @param batchQualifCm Commentaire de qualifcation du lot
225 * @param updateDt Date de maj
226 * @param remoteId
227 * @return Batch
228 */
229 public Batch create(
230 String batchNm,
231 String batchLb,
232 String batchExperCond,
233 Integer batchBreedingStructurUnit,
234 Integer batchBreedingSystemUnit,
235 String batchCm,
236 Date batchControlDt,
237 Date batchValidDt,
238 Date batchQualifDt,
239 String batchQualifCm,
240 Timestamp updateDt,
241 Integer remoteId);
242
243 /**
244 * <p>
245 * Does the same thing as {@link #create(String, String, String, Integer, Integer, String, Date, Date, Date, String, Timestamp, Integer)} with an
246 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
247 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
248 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
249 * transform the entity (into a value object for example). By default, transformation does
250 * not occur.
251 * </p>
252 * @param transform
253 * @param batchNm Libellé du lot
254 * @param batchLb Mnémonique du lot
255 * @param batchExperCond Conditions d'expérimentation
256 * @param batchBreedingStructurUnit Nombre d'occurences de la structure d'élevage
257 * @param batchBreedingSystemUnit Nombre d'occurences du système d'élevage
258 * @param batchCm Commentaire sur le lot
259 * @param batchControlDt Date de contrôle du lot
260 * @param batchValidDt Date de validation du lot
261 * @param batchQualifDt Date de qualification du lot
262 * @param batchQualifCm Commentaire de qualifcation du lot
263 * @param updateDt Date de maj
264 * @param remoteId
265 * @return Batch
266 */
267 public Object create(
268 int transform,
269 String batchNm,
270 String batchLb,
271 String batchExperCond,
272 Integer batchBreedingStructurUnit,
273 Integer batchBreedingSystemUnit,
274 String batchCm,
275 Date batchControlDt,
276 Date batchValidDt,
277 Date batchQualifDt,
278 String batchQualifCm,
279 Timestamp updateDt,
280 Integer remoteId);
281
282 /**
283 * <p>
284 * Creates a new <code>Batch</code>
285 * instance from only <strong>required</strong> properties (attributes
286 * and association ends) and adds it to the persistent store.
287 * </p>
288 * @param batchLb
289 * @param batchNm
290 * @param breedingStructure
291 * @param breedingSystem
292 * @param initialPopulation
293 * @param monitoringLocation
294 * @param qualityFlag
295 * @return Batch
296 */
297 public Batch create(
298 String batchLb,
299 String batchNm,
300 BreedingStructure breedingStructure,
301 BreedingSystem breedingSystem,
302 InitialPopulation initialPopulation,
303 MonitoringLocation monitoringLocation,
304 QualityFlag qualityFlag);
305
306 /**
307 * <p>
308 * Does the same thing as {@link #create(String, String)} with an
309 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
310 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
311 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
312 * transform the entity (into a value object for example). By default, transformation does
313 * not occur.
314 * </p>
315 * @param transform flag to determine transformation type.
316 * @param batchLb
317 * @param batchNm
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 BreedingStructure breedingStructure,
330 BreedingSystem breedingSystem,
331 InitialPopulation initialPopulation,
332 MonitoringLocation monitoringLocation,
333 QualityFlag qualityFlag);
334
335 /**
336 * Updates the <code>batch</code> instance in the persistent store.
337 * @param batch
338 */
339 public void update(Batch batch);
340
341 /**
342 * Updates all instances in the <code>entities</code> collection in the persistent store.
343 * @param entities
344 */
345 public void update(Collection<Batch> entities);
346
347 /**
348 * Removes the instance of Batch from the persistent store.
349 * @param batch
350 */
351 public void remove(Batch batch);
352
353 /**
354 * Removes the instance of Batch having the given
355 * <code>identifier</code> from the persistent store.
356 * @param batchId
357 */
358 public void remove(Integer batchId);
359
360 /**
361 * Removes all entities in the given <code>entities</code> collection.
362 * @param entities
363 */
364 public void remove(Collection<Batch> entities);
365
366
367 /**
368 * Does the same thing as {@link #search(int, Search)} but with an
369 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
370 * limit your data to a specified page number and size.
371 *
372 * @param transform the transformation flag.
373 * @param pageNumber the page number in the data to retrieve
374 * @param pageSize the size of the page to retrieve.
375 * @param search the search object which provides the search parameters and pagination specification.
376 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
377 */
378 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
379
380 /**
381 * Does the same thing as {@link #search(Search)} but with an
382 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
383 * limit your data to a specified page number and size.
384 *
385 * @param pageNumber the page number in the data to retrieve
386 * @param pageSize the size of the page to retrieve.
387 * @param search the search object which provides the search parameters and pagination specification.
388 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
389 */
390 public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
391
392 /**
393 * Does the same thing as {@link #search(Search)} but with an
394 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
395 * finder results will <strong>NOT</strong> be transformed during retrieval.
396 * If this flag is any of the other constants defined here
397 * then results <strong>WILL BE</strong> passed through an operation which can optionally
398 * transform the entities (into value objects for example). By default, transformation does
399 * not occur.
400 *
401 * @param transform the transformation flag.
402 * @param search the search object which provides the search parameters and pagination specification.
403 * @return any found results from the search.
404 */
405 public Set<?> search(final int transform, final Search search);
406
407 /**
408 * Performs a search using the parameters specified in the given <code>search</code> object.
409 *
410 * @param search the search object which provides the search parameters and pagination specification.
411 * @return any found results from the search.
412 */
413 public Set<Batch> search(final Search search);
414
415 /**
416 * Allows transformation of entities into value objects
417 * (or something else for that matter), when the <code>transform</code>
418 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige3.core.dao.data.aquaculture.BatchDao</code>, please note
419 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
420 * will be returned.
421 *
422 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
423 *
424 * @param transform one of the constants declared in {@link fr.ifremer.quadrige3.core.dao.data.aquaculture.BatchDao}
425 * @param entity an entity that was found
426 * @return the transformed entity (i.e. new value object, etc)
427 * @see #transformEntities(int,Collection)
428 */
429 public Object transformEntity(final int transform, final Batch entity);
430
431 /**
432 * Transforms a collection of entities using the
433 * {@link #transformEntity(int,Batch)}
434 * method. This method does not instantiate a new collection.
435 * <p>
436 * This method is to be used internally only.
437 *
438 * @param transform one of the constants declared in <code>fr.ifremer.quadrige3.core.dao.data.aquaculture.BatchDao</code>
439 * @param entities the collection of entities to transform
440 * @see #transformEntity(int,Batch)
441 */
442 public void transformEntities(final int transform, final Collection<?> entities);
443
444 // spring-dao merge-point
445 }