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.produce;
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.data.measure.ProduceQuantificationMeasurement;
033import fr.ifremer.adagio.core.dao.referential.QualityFlag;
034import fr.ifremer.adagio.core.dao.referential.taxon.TaxonGroup;
035import java.util.Collection;
036import java.util.Date;
037import java.util.Set;
038import org.andromda.spring.PaginationResult;
039
040/**
041 * <html>
042 * <head>
043 * </head>
044 * <body>
045 * <p>
046 * Un produit est identifi&#233; par une esp&#232;ce commerciale, un &#233;tat, une
047 * qualit&#233;, pr&#233;sentation et cat&#233;gorie commerciale.
048 * </p>
049 * <p>
050 * </p>
051 * <p>
052 * <u>Si le produit est un &quot;produit vendu&quot; :</u>
053 * </p>
054 * <p>
055 * On pourra allors utiliser SortingMeasurement pour stocker des donn&#233;es
056 * &#233;conomiques, comme par exemple :
057 * </p>
058 * <p>
059 * - Le prix du produit. Il peut y avoir plusieurds prix (plusieurs PSFMs),
060 * par exemple : prix au kilo, et prix total en euros.
061 * </p>
062 * <p>
063 * - Valorisation de la commercialisation : Label rouge, Eco Label, marque
064 * collective control&#233;e par un organisme tier. (cf SACROIS)
065 * </p>
066 * <p>
067 * - Destination commerciale : consommation humaine, consommation animale,
068 * etc .
069 * </p>
070 * </body>
071 * </html>
072 * @see Produce
073 */
074public interface ProduceDao
075{
076    /**
077     * This constant is used as a transformation flag; entities can be converted automatically into value objects
078     * or other types, different methods in a class implementing this interface support this feature: look for
079     * an <code>int</code> parameter called <code>transform</code>.
080     * <p>
081     * This specific flag denotes no transformation will occur.
082     */
083    public static final int TRANSFORM_NONE = 0;
084
085
086    /**
087     * Transforms the given results to a collection of {@link Produce}
088     * instances (this is useful when the returned results contains a row of data and you want just entities only).
089     *
090     * @param results the query results.
091     */
092    public void toEntities(final Collection<?> results);
093
094    /**
095     * Gets an instance of Produce from the persistent store.
096     * @param id
097     * @return Produce
098     */
099    public Produce get(Integer id);
100
101    /**
102     * <p>
103     * Does the same thing as {@link #get(Integer)} with an
104     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
105     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
106     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
107     * optionally transform the entity (into a value object for example). By default, transformation does
108     * not occur.
109     * </p>
110     *
111     * @param transform flag to determine transformation type.
112     * @param id the identifier of the entity to get.
113     * @return either the entity or the object transformed from the entity.
114     */
115    public Object get(int transform, Integer id);
116
117    /**
118     * Loads an instance of Produce from the persistent store.
119     * @param id
120     * @return Produce
121     */
122    public Produce load(Integer id);
123
124    /**
125     * <p>
126     * Does the same thing as {@link #load(Integer)} with an
127     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
128     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
129     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
130     * optionally transform the entity (into a value object for example). By default, transformation does
131     * not occur.
132     * </p>
133     *
134     * @param transform flag to determine transformation type.
135     * @param id the identifier of the entity to load.
136     * @return either the entity or the object transformed from the entity.
137     */
138    public Object load(int transform, Integer id);
139
140    /**
141     * Loads all entities of type {@link Produce}.
142     *
143     * @return the loaded entities.
144     */
145    public Collection<Produce> loadAll();
146
147    /**
148     * <p>
149     * Does the same thing as {@link #loadAll()} with an
150     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
151     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
152     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
153     * transform the entity (into a value object for example). By default, transformation does
154     * not occur.
155     * </p>
156     *
157     * @param transform the flag indicating what transformation to use.
158     * @return the loaded entities.
159     */
160    public Collection<?> loadAll(final int transform);
161
162    /**
163     * <p>
164     * Does the same thing as {@link #loadAll()} with an
165     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
166     * 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
167     * page retrieved.
168     * </p>
169     *
170     * @param pageNumber the page number to retrieve when paging results.
171     * @param pageSize the size of the page to retrieve when paging results.
172     * @return the loaded entities.
173     */
174    public Collection<?> loadAll(final int pageNumber, final int pageSize);
175
176    /**
177     * <p>
178     * Does the same thing as {@link #loadAll(int)} with an
179     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
180     * 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
181     * page retrieved.
182     * </p>
183     *
184     * @param transform the flag indicating what transformation to use.
185     * @param pageNumber the page number to retrieve when paging results.
186     * @param pageSize the size of the page to retrieve when paging results.
187     * @return the loaded entities.
188     */
189    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
190
191    /**
192     * Creates an instance of Produce and adds it to the persistent store.
193     * @param produce
194     * @return Produce
195     */
196    public Produce create(Produce produce);
197
198    /**
199     * <p>
200     * Does the same thing as {@link #create(Produce)} with an
201     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
202     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
203     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
204     * transform the entity (into a value object for example). By default, transformation does
205     * not occur.
206     * </p>
207     * @param transform
208     * @param produce
209     * @return Object
210     */
211    public Object create(int transform, Produce produce);
212
213    /**
214     * Creates a new instance of Produce and adds
215     * from the passed in <code>entities</code> collection
216     *
217     * @param entities the collection of Produce
218     * instances to create.
219     *
220     * @return the created instances.
221     */
222    public Collection<Produce> create(Collection<Produce> entities);
223
224    /**
225     * <p>
226     * Does the same thing as {@link #create(Produce)} with an
227     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
228     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
229     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
230     * transform the entities (into value objects for example). By default, transformation does
231     * not occur.
232     * </p>
233     * @param transform
234     * @param entities
235     * @return Collection
236     */
237    public Collection<?> create(int transform, Collection<Produce> entities);
238
239    /**
240     * <p>
241     * Creates a new <code>Produce</code>
242     * instance from <strong>all</strong> attributes and adds it to
243     * the persistent store.
244     * </p>
245     * @param isDiscard Le produit est-il un rejet ou non ?
246     * @param subgroupCount Nombre de sous ensembles ayant servit à la quantification.
247Par exemple il pourra s'agir d'un nombre de caisse servant à quantifié le produit.
248Par exemple, pour une détermination de la quantification par les volumes :
249- nombre_sous_ensembles_quantifiés = 3
250- poids moyen par sous-ensemble = 5 kg
251=> Poids total du lot = 3 x 5 = 15kg
252     * @param individualCount Nombre d'individus (optionnel). Utile pour les très gros individu.
253Ex : 1 espadon de 150kg
254     * @param taxonGroupOtherInformation Autre information sur l'espèce du produit.
255Utilisé dans SACROIS/RIC2, pour stocker des informations complémentaires issues du référentiel
256espèce du Réseau Inter Criée (RIC).
257     * @param controlDate 
258     * @param validationDate 
259     * @param qualificationDate 
260     * @param qualificationComments 
261     * @param weight Poids total du lot/produit (en kg).
262Il peut s'agir d'une poids vif ou d'un poids brut, suivant si la la présence ou l'absence de l’état
263et de la présentation.
264@since 3.5.0
265     * @param cost Prix total, exprimé dans l'unité utilisée par du système SIH (€, DH, SR, ...)
266@since 3.5.0
267     * @return Produce
268     */
269    public Produce create(
270        Boolean isDiscard,
271        Float subgroupCount,
272        Short individualCount,
273        String taxonGroupOtherInformation,
274        Date controlDate,
275        Date validationDate,
276        Date qualificationDate,
277        String qualificationComments,
278        Float weight,
279        Float cost);
280
281    /**
282     * <p>
283     * Does the same thing as {@link #create(Boolean, Float, Short, String, Date, Date, Date, String, Float, Float)} with an
284     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
285     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
286     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
287     * transform the entity (into a value object for example). By default, transformation does
288     * not occur.
289     * </p>
290     * @param transform
291     * @param isDiscard Le produit est-il un rejet ou non ?
292     * @param subgroupCount Nombre de sous ensembles ayant servit à la quantification.
293Par exemple il pourra s'agir d'un nombre de caisse servant à quantifié le produit.
294Par exemple, pour une détermination de la quantification par les volumes :
295- nombre_sous_ensembles_quantifiés = 3
296- poids moyen par sous-ensemble = 5 kg
297=> Poids total du lot = 3 x 5 = 15kg
298     * @param individualCount Nombre d'individus (optionnel). Utile pour les très gros individu.
299Ex : 1 espadon de 150kg
300     * @param taxonGroupOtherInformation Autre information sur l'espèce du produit.
301Utilisé dans SACROIS/RIC2, pour stocker des informations complémentaires issues du référentiel
302espèce du Réseau Inter Criée (RIC).
303     * @param controlDate 
304     * @param validationDate 
305     * @param qualificationDate 
306     * @param qualificationComments 
307     * @param weight Poids total du lot/produit (en kg).
308Il peut s'agir d'une poids vif ou d'un poids brut, suivant si la la présence ou l'absence de l’état
309et de la présentation.
310@since 3.5.0
311     * @param cost Prix total, exprimé dans l'unité utilisée par du système SIH (€, DH, SR, ...)
312@since 3.5.0
313     * @return Produce
314     */
315    public Object create(
316        int transform,
317        Boolean isDiscard,
318        Float subgroupCount,
319        Short individualCount,
320        String taxonGroupOtherInformation,
321        Date controlDate,
322        Date validationDate,
323        Date qualificationDate,
324        String qualificationComments,
325        Float weight,
326        Float cost);
327
328    /**
329     * <p>
330     * Creates a new <code>Produce</code>
331     * instance from only <strong>required</strong> properties (attributes
332     * and association ends) and adds it to the persistent store.
333     * </p>
334     * @param isDiscard
335     * @param produceQuantificationMeasurements
336     * @param qualityFlag
337     * @param taxonGroup
338     * @return Produce
339     */
340    public Produce create(
341        Boolean isDiscard,
342        Collection<ProduceQuantificationMeasurement> produceQuantificationMeasurements,
343        QualityFlag qualityFlag,
344        TaxonGroup taxonGroup);
345
346    /**
347     * <p>
348     * Does the same thing as {@link #create(Boolean)} with an
349     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
350     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
351     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
352     * transform the entity (into a value object for example). By default, transformation does
353     * not occur.
354     * </p>
355     * @param transform flag to determine transformation type.
356     * @param isDiscard
357     * @param produceQuantificationMeasurements
358     * @param qualityFlag
359     * @param taxonGroup
360     * @return Object
361     */
362    public Object create(
363        int transform,
364        Boolean isDiscard,
365        Collection<ProduceQuantificationMeasurement> produceQuantificationMeasurements,
366        QualityFlag qualityFlag,
367        TaxonGroup taxonGroup);
368
369    /**
370     * Updates the <code>produce</code> instance in the persistent store.
371     * @param produce
372     */
373    public void update(Produce produce);
374
375    /**
376     * Updates all instances in the <code>entities</code> collection in the persistent store.
377     * @param entities
378     */
379    public void update(Collection<Produce> entities);
380
381    /**
382     * Removes the instance of Produce from the persistent store.
383     * @param produce
384     */
385    public void remove(Produce produce);
386
387    /**
388     * Removes the instance of Produce having the given
389     * <code>identifier</code> from the persistent store.
390     * @param id
391     */
392    public void remove(Integer id);
393
394    /**
395     * Removes all entities in the given <code>entities</code> collection.
396     * @param entities
397     */
398    public void remove(Collection<Produce> entities);
399
400
401    /**
402     * Does the same thing as {@link #search(int, Search)} but with an
403     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
404     * limit your data to a specified page number and size.
405     *
406     * @param transform the transformation flag.
407     * @param pageNumber the page number in the data to retrieve
408     * @param pageSize the size of the page to retrieve.
409     * @param search the search object which provides the search parameters and pagination specification.
410     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
411     */
412    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
413
414    /**
415     * Does the same thing as {@link #search(Search)} but with an
416     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
417     * limit your data to a specified page number and size.
418     *
419     * @param pageNumber the page number in the data to retrieve
420     * @param pageSize the size of the page to retrieve.
421     * @param search the search object which provides the search parameters and pagination specification.
422     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
423     */
424    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
425
426    /**
427     * Does the same thing as {@link #search(Search)} but with an
428     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
429     * finder results will <strong>NOT</strong> be transformed during retrieval.
430     * If this flag is any of the other constants defined here
431     * then results <strong>WILL BE</strong> passed through an operation which can optionally
432     * transform the entities (into value objects for example). By default, transformation does
433     * not occur.
434     *
435     * @param transform the transformation flag.
436     * @param search the search object which provides the search parameters and pagination specification.
437     * @return any found results from the search.
438     */
439    public Set<?> search(final int transform, final Search search);
440
441    /**
442     * Performs a search using the parameters specified in the given <code>search</code> object.
443     *
444     * @param search the search object which provides the search parameters and pagination specification.
445     * @return any found results from the search.
446     */
447    public Set<Produce> search(final Search search);
448
449    /**
450     * Allows transformation of entities into value objects
451     * (or something else for that matter), when the <code>transform</code>
452     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.data.produce.ProduceDao</code>, please note
453     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
454     * will be returned.
455     *
456     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
457     *
458     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.data.produce.ProduceDao}
459     * @param entity an entity that was found
460     * @return the transformed entity (i.e. new value object, etc)
461     * @see #transformEntities(int,Collection)
462     */
463    public Object transformEntity(final int transform, final Produce entity);
464
465    /**
466     * Transforms a collection of entities using the
467     * {@link #transformEntity(int,Produce)}
468     * method. This method does not instantiate a new collection.
469     * <p>
470     * This method is to be used internally only.
471     *
472     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.data.produce.ProduceDao</code>
473     * @param entities the collection of entities to transform
474     * @see #transformEntity(int,Produce)
475     */
476    public void transformEntities(final int transform, final Collection<?> entities);
477
478    // spring-dao merge-point
479}