001// license-header java merge-point
002//
003// Attention: Generated code! Do not modify by hand!
004// Generated by: SpringDao.vsl in andromda-spring-cartridge.
005//
006package fr.ifremer.adagio.core.dao.data.batch;
007
008/*
009 * #%L
010 * SIH-Adagio :: Core
011 * $Id:$
012 * $HeadURL:$
013 * %%
014 * Copyright (C) 2012 - 2014 Ifremer
015 * %%
016 * This program is free software: you can redistribute it and/or modify
017 * it under the terms of the GNU Affero General Public License as published by
018 * the Free Software Foundation, either version 3 of the License, or
019 * (at your option) any later version.
020 * 
021 * This program is distributed in the hope that it will be useful,
022 * but WITHOUT ANY WARRANTY; without even the implied warranty of
023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
024 * GNU General Public License for more details.
025 * 
026 * You should have received a copy of the GNU Affero General Public License
027 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
028 * #L%
029 */
030
031import fr.ifremer.adagio.core.dao.Search;
032import fr.ifremer.adagio.core.dao.referential.QualityFlag;
033import java.sql.Timestamp;
034import java.util.Collection;
035import java.util.Date;
036import java.util.Set;
037import org.andromda.spring.PaginationResult;
038
039/**
040 * Capture réalisée au cours d'une opération, et sur laquelle un échantillonnage est réalisé.
041 * La capture porte donc l'arbre d''échantillonnage.
042 * @see CatchBatch
043 */
044public interface CatchBatchDao
045{
046    /**
047     * This constant is used as a transformation flag; entities can be converted automatically into value objects
048     * or other types, different methods in a class implementing this interface support this feature: look for
049     * an <code>int</code> parameter called <code>transform</code>.
050     * <p>
051     * This specific flag denotes no transformation will occur.
052     */
053    public static final int TRANSFORM_NONE = 0;
054
055
056    /**
057     * Transforms the given results to a collection of {@link CatchBatch}
058     * instances (this is useful when the returned results contains a row of data and you want just entities only).
059     *
060     * @param results the query results.
061     */
062    public void toEntities(final Collection<?> results);
063
064    /**
065     * Gets an instance of CatchBatch from the persistent store.
066     * @param id
067     * @return CatchBatch
068     */
069    public CatchBatch get(Integer id);
070
071    /**
072     * <p>
073     * Does the same thing as {@link #get(Integer)} with an
074     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
075     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
076     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
077     * optionally transform the entity (into a value object for example). By default, transformation does
078     * not occur.
079     * </p>
080     *
081     * @param transform flag to determine transformation type.
082     * @param id the identifier of the entity to get.
083     * @return either the entity or the object transformed from the entity.
084     */
085    public Object get(int transform, Integer id);
086
087    /**
088     * Loads an instance of CatchBatch from the persistent store.
089     * @param id
090     * @return CatchBatch
091     */
092    public CatchBatch load(Integer id);
093
094    /**
095     * <p>
096     * Does the same thing as {@link #load(Integer)} with an
097     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
098     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
099     * 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 id 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 id);
109
110    /**
111     * Loads all entities of type {@link CatchBatch}.
112     *
113     * @return the loaded entities.
114     */
115    public Collection<CatchBatch> 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 CatchBatch and adds it to the persistent store.
163     * @param catchBatch
164     * @return CatchBatch
165     */
166    public CatchBatch create(CatchBatch catchBatch);
167
168    /**
169     * <p>
170     * Does the same thing as {@link #create(CatchBatch)} 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 catchBatch
179     * @return Object
180     */
181    public Object create(int transform, CatchBatch catchBatch);
182
183    /**
184     * Creates a new instance of CatchBatch and adds
185     * from the passed in <code>entities</code> collection
186     *
187     * @param entities the collection of CatchBatch
188     * instances to create.
189     *
190     * @return the created instances.
191     */
192    public Collection<CatchBatch> create(Collection<CatchBatch> entities);
193
194    /**
195     * <p>
196     * Does the same thing as {@link #create(CatchBatch)} 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<CatchBatch> entities);
208
209    /**
210     * <p>
211     * Creates a new <code>CatchBatch</code>
212     * instance from <strong>all</strong> attributes and adds it to
213     * the persistent store.
214     * </p>
215     * @param synchronizationStatus Etat de synchronisation (en cours, terminé, en attente de synchro, supprimé). Seulement visible dans
216la base locale.
217     * @param controlDate 
218     * @param validationDate 
219     * @param qualificationDate 
220     * @param qualificationComments 
221     * @param updateDate 
222     * @param rankOrder Numéro d'ordre du lot.
223Sert pour déterminer l'ordre de présentation des lots rattaché à un même lot père.
224     * @param label Libellé du lot (besoin pour le flux d'échantillonnage ISCAX).
225mantis #13091
226     * @param subgroupCount Nombre de sous ensembles ayant servit à la quantification. Attention : Il ne s'agit pas du nombre de
227lot fils.
228Par exemple il pourra s'agir d'un nombre de caisse servant à quantifié le lot.
229Par exemple, pour une détermination de la quantification par les volumes :
230- nombre_sous_ensembles_quantifiés = 3
231- poids moyen par sous-ensemble = 5 kg
232=> Poids total du lot = 3 x 5 = 15kg
233     * @param individualCount Nombre d'individus comptés.
234Passage en Integer (sous oracle = NUMBER(10)) pour les besoins des données historiques SIH-OBSMER.
235     * @param childBatchsReplication Indique si les lots fils sont des réplicats ou non. Attribut non renseigné si un des lots père est
236rattaché à un taxon ou groupe de taxon.
237     * @param exhaustiveInventory <html>
238<head>
239</head>
240<body>
241<p>
242Indique si l'inventaire des esp&#232;ces scientifiques (ReferenceTaxon) est
243exhaustif ou non.Attribut non renseign&#233; si le lot ou un de ses lots p&#232;re
244est rattach&#233; &#224; un taxon.
245</p>
246<p>
247</p>
248<p>
249Si l'inventaire est exhautif, il convient de remplir <i>BatchExhautiveInventory</i>,
250pour tracer sur quelle liste d'esp&#232;ces porte l'exhaustivit&#233;. Si
251<i>BatchExhautiveInventory</i>
252n'est pas renseign&#233;, alors l'exhautivit&#233; porte sur toutes les esp&#232;ces.
253</p>
254</body>
255</html>
256     * @param comments 
257     * @return CatchBatch
258     */
259    public CatchBatch create(
260        
261        Date controlDate,
262        Date validationDate,
263        Date qualificationDate,
264        String qualificationComments,
265        Timestamp updateDate,
266        Short rankOrder,
267        String label,
268        Float subgroupCount,
269        Integer individualCount,
270        Boolean childBatchsReplication,
271        Boolean exhaustiveInventory,
272        String comments);
273
274    /**
275     * <p>
276     * Does the same thing as {@link #create(String, Date, Date, Date, String, Timestamp, Short, String, Float, Integer, Boolean, Boolean, String)} with an
277     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
278     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
279     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
280     * transform the entity (into a value object for example). By default, transformation does
281     * not occur.
282     * </p>
283     * @param transform
284     * @param synchronizationStatus Etat de synchronisation (en cours, terminé, en attente de synchro, supprimé). Seulement visible dans
285la base locale.
286     * @param controlDate 
287     * @param validationDate 
288     * @param qualificationDate 
289     * @param qualificationComments 
290     * @param updateDate 
291     * @param rankOrder Numéro d'ordre du lot.
292Sert pour déterminer l'ordre de présentation des lots rattaché à un même lot père.
293     * @param label Libellé du lot (besoin pour le flux d'échantillonnage ISCAX).
294mantis #13091
295     * @param subgroupCount Nombre de sous ensembles ayant servit à la quantification. Attention : Il ne s'agit pas du nombre de
296lot fils.
297Par exemple il pourra s'agir d'un nombre de caisse servant à quantifié le lot.
298Par exemple, pour une détermination de la quantification par les volumes :
299- nombre_sous_ensembles_quantifiés = 3
300- poids moyen par sous-ensemble = 5 kg
301=> Poids total du lot = 3 x 5 = 15kg
302     * @param individualCount Nombre d'individus comptés.
303Passage en Integer (sous oracle = NUMBER(10)) pour les besoins des données historiques SIH-OBSMER.
304     * @param childBatchsReplication Indique si les lots fils sont des réplicats ou non. Attribut non renseigné si un des lots père est
305rattaché à un taxon ou groupe de taxon.
306     * @param exhaustiveInventory <html>
307<head>
308</head>
309<body>
310<p>
311Indique si l'inventaire des esp&#232;ces scientifiques (ReferenceTaxon) est
312exhaustif ou non.Attribut non renseign&#233; si le lot ou un de ses lots p&#232;re
313est rattach&#233; &#224; un taxon.
314</p>
315<p>
316</p>
317<p>
318Si l'inventaire est exhautif, il convient de remplir <i>BatchExhautiveInventory</i>,
319pour tracer sur quelle liste d'esp&#232;ces porte l'exhaustivit&#233;. Si
320<i>BatchExhautiveInventory</i>
321n'est pas renseign&#233;, alors l'exhautivit&#233; porte sur toutes les esp&#232;ces.
322</p>
323</body>
324</html>
325     * @param comments 
326     * @return CatchBatch
327     */
328    public Object create(
329        int transform,
330        
331        Date controlDate,
332        Date validationDate,
333        Date qualificationDate,
334        String qualificationComments,
335        Timestamp updateDate,
336        Short rankOrder,
337        String label,
338        Float subgroupCount,
339        Integer individualCount,
340        Boolean childBatchsReplication,
341        Boolean exhaustiveInventory,
342        String comments);
343
344    /**
345     * <p>
346     * Creates a new <code>CatchBatch</code>
347     * instance from only <strong>required</strong> properties (attributes
348     * and association ends) and adds it to the persistent store.
349     * </p>
350     * @param childBatchsReplication
351     * @param exhaustiveInventory
352     * @param qualityFlag
353     * @param rankOrder
354     * @param synchronizationStatus
355     * @param updateDate
356     * @return CatchBatch
357     */
358    public CatchBatch create(
359        Boolean childBatchsReplication,
360        Boolean exhaustiveInventory,
361        QualityFlag qualityFlag,
362        Short rankOrder,
363        
364        Timestamp updateDate);
365
366    /**
367     * <p>
368     * Does the same thing as {@link #create(String, Timestamp, Short, Boolean, Boolean)} with an
369     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
370     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
371     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
372     * transform the entity (into a value object for example). By default, transformation does
373     * not occur.
374     * </p>
375     * @param transform flag to determine transformation type.
376     * @param childBatchsReplication
377     * @param exhaustiveInventory
378     * @param qualityFlag
379     * @param rankOrder
380     * @param synchronizationStatus
381     * @param updateDate
382     * @return Object
383     */
384    public Object create(
385        int transform,
386        Boolean childBatchsReplication,
387        Boolean exhaustiveInventory,
388        QualityFlag qualityFlag,
389        Short rankOrder,
390        
391        Timestamp updateDate);
392
393    /**
394     * Updates the <code>catchBatch</code> instance in the persistent store.
395     * @param catchBatch
396     */
397    public void update(CatchBatch catchBatch);
398
399    /**
400     * Updates all instances in the <code>entities</code> collection in the persistent store.
401     * @param entities
402     */
403    public void update(Collection<CatchBatch> entities);
404
405    /**
406     * Removes the instance of CatchBatch from the persistent store.
407     * @param catchBatch
408     */
409    public void remove(CatchBatch catchBatch);
410
411    /**
412     * Removes the instance of CatchBatch having the given
413     * <code>identifier</code> from the persistent store.
414     * @param id
415     */
416    public void remove(Integer id);
417
418    /**
419     * Removes all entities in the given <code>entities</code> collection.
420     * @param entities
421     */
422    public void remove(Collection<CatchBatch> entities);
423
424
425    /**
426     * Does the same thing as {@link #search(int, Search)} but with an
427     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
428     * limit your data to a specified page number and size.
429     *
430     * @param transform the transformation flag.
431     * @param pageNumber the page number in the data to retrieve
432     * @param pageSize the size of the page to retrieve.
433     * @param search the search object which provides the search parameters and pagination specification.
434     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
435     */
436    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
437
438    /**
439     * Does the same thing as {@link #search(Search)} but with an
440     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
441     * limit your data to a specified page number and size.
442     *
443     * @param pageNumber the page number in the data to retrieve
444     * @param pageSize the size of the page to retrieve.
445     * @param search the search object which provides the search parameters and pagination specification.
446     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
447     */
448    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
449
450    /**
451     * Does the same thing as {@link #search(Search)} but with an
452     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
453     * finder results will <strong>NOT</strong> be transformed during retrieval.
454     * If this flag is any of the other constants defined here
455     * then results <strong>WILL BE</strong> passed through an operation which can optionally
456     * transform the entities (into value objects for example). By default, transformation does
457     * not occur.
458     *
459     * @param transform the transformation flag.
460     * @param search the search object which provides the search parameters and pagination specification.
461     * @return any found results from the search.
462     */
463    public Set<?> search(final int transform, final Search search);
464
465    /**
466     * Performs a search using the parameters specified in the given <code>search</code> object.
467     *
468     * @param search the search object which provides the search parameters and pagination specification.
469     * @return any found results from the search.
470     */
471    public Set<CatchBatch> search(final Search search);
472
473    /**
474     * Allows transformation of entities into value objects
475     * (or something else for that matter), when the <code>transform</code>
476     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.data.batch.CatchBatchDao</code>, please note
477     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
478     * will be returned.
479     *
480     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
481     *
482     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.data.batch.CatchBatchDao}
483     * @param entity an entity that was found
484     * @return the transformed entity (i.e. new value object, etc)
485     * @see #transformEntities(int,Collection)
486     */
487    public Object transformEntity(final int transform, final CatchBatch entity);
488
489    /**
490     * Transforms a collection of entities using the
491     * {@link #transformEntity(int,CatchBatch)}
492     * method. This method does not instantiate a new collection.
493     * <p>
494     * This method is to be used internally only.
495     *
496     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.data.batch.CatchBatchDao</code>
497     * @param entities the collection of entities to transform
498     * @see #transformEntity(int,CatchBatch)
499     */
500    public void transformEntities(final int transform, final Collection<?> entities);
501
502    // spring-dao merge-point
503}