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.operation;
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 com.vividsolutions.jts.geom.LineString;
032import fr.ifremer.adagio.core.dao.Search;
033import fr.ifremer.adagio.core.dao.data.vessel.Vessel;
034import fr.ifremer.adagio.core.dao.referential.QualityFlag;
035import java.util.Collection;
036import java.util.Date;
037import java.util.Set;
038import org.andromda.spring.PaginationResult;
039
040/**
041 * Opération de peche durant laquelle un prélèvement peut etre effectué, au cours d'une sortie en
042 * mer (marée observée en mer, marée enquetée au débarquement, sortie lors d'une campagne à la mer,
043 * etc.).
044 * Il peut également s'agir d'une séquence de peche, lorsque les dates début/fin ne sont pas connus,
045 * et si la zone de peche est unique.
046 * Les dates/heures et lat/long de début/fin caractérisent le début/fin de la capture réalisée (hors
047 * temps d'établissement de l'engin).
048 * REMARQUE : les caractéristiques "indicateur jour/nuit" et "Trajectoire rectiligne ou non" sont
049 * présent à ce niveau dans Harmonie, mais gérés dans Allegro via les "cracatéristique d'utilisation
050 * du navire" (VesselUseFeatures) rattachée à l'opération parente.
051 * @see FishingOperation
052 */
053public interface FishingOperationDao
054{
055    /**
056     * This constant is used as a transformation flag; entities can be converted automatically into value objects
057     * or other types, different methods in a class implementing this interface support this feature: look for
058     * an <code>int</code> parameter called <code>transform</code>.
059     * <p>
060     * This specific flag denotes no transformation will occur.
061     */
062    public static final int TRANSFORM_NONE = 0;
063
064
065    /**
066     * Transforms the given results to a collection of {@link FishingOperation}
067     * instances (this is useful when the returned results contains a row of data and you want just entities only).
068     *
069     * @param results the query results.
070     */
071    public void toEntities(final Collection<?> results);
072
073    /**
074     * Gets an instance of FishingOperation from the persistent store.
075     * @param id
076     * @return FishingOperation
077     */
078    public FishingOperation get(Integer id);
079
080    /**
081     * <p>
082     * Does the same thing as {@link #get(Integer)} with an
083     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
084     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
085     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
086     * optionally transform the entity (into a value object for example). By default, transformation does
087     * not occur.
088     * </p>
089     *
090     * @param transform flag to determine transformation type.
091     * @param id the identifier of the entity to get.
092     * @return either the entity or the object transformed from the entity.
093     */
094    public Object get(int transform, Integer id);
095
096    /**
097     * Loads an instance of FishingOperation from the persistent store.
098     * @param id
099     * @return FishingOperation
100     */
101    public FishingOperation load(Integer id);
102
103    /**
104     * <p>
105     * Does the same thing as {@link #load(Integer)} with an
106     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
107     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
108     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
109     * optionally transform the entity (into a value object for example). By default, transformation does
110     * not occur.
111     * </p>
112     *
113     * @param transform flag to determine transformation type.
114     * @param id the identifier of the entity to load.
115     * @return either the entity or the object transformed from the entity.
116     */
117    public Object load(int transform, Integer id);
118
119    /**
120     * Loads all entities of type {@link FishingOperation}.
121     *
122     * @return the loaded entities.
123     */
124    public Collection<FishingOperation> loadAll();
125
126    /**
127     * <p>
128     * Does the same thing as {@link #loadAll()} with an
129     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
130     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
131     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
132     * transform the entity (into a value object for example). By default, transformation does
133     * not occur.
134     * </p>
135     *
136     * @param transform the flag indicating what transformation to use.
137     * @return the loaded entities.
138     */
139    public Collection<?> loadAll(final int transform);
140
141    /**
142     * <p>
143     * Does the same thing as {@link #loadAll()} with an
144     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
145     * 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
146     * page retrieved.
147     * </p>
148     *
149     * @param pageNumber the page number to retrieve when paging results.
150     * @param pageSize the size of the page to retrieve when paging results.
151     * @return the loaded entities.
152     */
153    public Collection<?> loadAll(final int pageNumber, final int pageSize);
154
155    /**
156     * <p>
157     * Does the same thing as {@link #loadAll(int)} with an
158     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
159     * 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
160     * page retrieved.
161     * </p>
162     *
163     * @param transform the flag indicating what transformation to use.
164     * @param pageNumber the page number to retrieve when paging results.
165     * @param pageSize the size of the page to retrieve when paging results.
166     * @return the loaded entities.
167     */
168    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
169
170    /**
171     * Creates an instance of FishingOperation and adds it to the persistent store.
172     * @param fishingOperation
173     * @return FishingOperation
174     */
175    public FishingOperation create(FishingOperation fishingOperation);
176
177    /**
178     * <p>
179     * Does the same thing as {@link #create(FishingOperation)} with an
180     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
181     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
182     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
183     * transform the entity (into a value object for example). By default, transformation does
184     * not occur.
185     * </p>
186     * @param transform
187     * @param fishingOperation
188     * @return Object
189     */
190    public Object create(int transform, FishingOperation fishingOperation);
191
192    /**
193     * Creates a new instance of FishingOperation and adds
194     * from the passed in <code>entities</code> collection
195     *
196     * @param entities the collection of FishingOperation
197     * instances to create.
198     *
199     * @return the created instances.
200     */
201    public Collection<FishingOperation> create(Collection<FishingOperation> entities);
202
203    /**
204     * <p>
205     * Does the same thing as {@link #create(FishingOperation)} with an
206     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
207     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
208     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
209     * transform the entities (into value objects for example). By default, transformation does
210     * not occur.
211     * </p>
212     * @param transform
213     * @param entities
214     * @return Collection
215     */
216    public Collection<?> create(int transform, Collection<FishingOperation> entities);
217
218    /**
219     * <p>
220     * Creates a new <code>FishingOperation</code>
221     * instance from <strong>all</strong> attributes and adds it to
222     * the persistent store.
223     * </p>
224     * @param fishingStartDateTime Date/heure au début du prélèvement.
225Par exemple, pour le cas d'une opération avec un chalut, il s'agit la date/heure à l'établissement
226du chalut (le temps de descente n'est pas pris en compte).
227     * @param fishingEndDateTime Date/heure à la fin du prélèvement.
228Par exemple, pour le cas d'une opération avec un chalut, le temps de remontée n'est pas
229comptabilisé.
230     * @param hasCatch Une capture a t elle été prélevée ?
231Si non, il s'agit d'une opération de peche infructueuse.
232A priori, si une capture avec quantification différente de 0 est saisie, ou bien si des produits
233sont rattachés à l'opération, alors hasCatch=true (HAS_CATCH=1).
234Si on ne sait pas si une capture a été réalisée ou non, le champ est laissé vide.
235Champ utile pour les marées observées au débarquement, pour lesquelles on ne peut pas saisir
236systématiquement de lot capture ou bien des produits.
237     * @param name @deprecated - NE PLUS UTILISER
238Libellé de l'opération.
239REMARQUE : attribut absent des IHM. Présent pour les données historiques. Sans doute à supprimer
240dans l'avenir.
241     * @param rankOrderOnPeriod Rang (de présentation) de l'opération, sur la période date début/fin.
242ATTENTION : Lorsque plusieurs opérations sont présentes sur la meme période, cela permet de les
243dissocier.
244C'est par exemple le cas des séquences de peches (opérations agrégées en Jour/Métier/Secteur) :
245plusieurs opérations peuvent etre sur le meme jour (avec des engin/secteur différents), il faut donc
246leur attribuer un rang, pour les distinguer. Ce rang peut etre celui de la déclaration du pecheur
247(ordre de saisie), ou bien un ordre quelconque.
248Dans Allegro, ce rang sera utilisé pour ordonner ces opérations entre elles, dans les listes qui les
249représentent. S'il est absent, seule la date de début est utilisée pour cela.
250     * @param startDateTime Date/heure de début de l'opération
251     * @param endDateTime Date/heure de fin de l'opération
252     * @param isMainOperation <html>
253<head>
254<style>
255p {padding:0px; margin:0px;}
256</style>
257</head>
258<body>
259<p>
260Indique s'il s'agit d'une opération ou d'un groupe d'opérations &quot;principal&quot;.
261</p>
262<p>
263Cela est utilisé notamment quand on ne connait que l'activité principale (le métier) d'un navire. On
264parle alors de métrier principal.
265<br>
266</p>
267<p>
268&#160;
269</p>
270<p>
271Généralement, cet atrribut est utilisé pour des groupes d'opérations (<i>rankOrderOnPerod is not
272null</i>), pour identifier sur la marée ou une journée de peche, le groupe d'opération portant le
273métier principal de la marée ou de la journée.
274</p>
275</body>
276</html>
277     * @param position Géométrie de l'opération.
278Ce champ est optionnel pour etre compatible avec uDIG/geotools.
279     * @param comments 
280     * @param controlDate 
281     * @param validationDate 
282     * @param qualificationDate 
283     * @param qualificationComments 
284     * @return FishingOperation
285     */
286    public FishingOperation create(
287        Date fishingStartDateTime,
288        Date fishingEndDateTime,
289        Boolean hasCatch,
290        String name,
291        Short rankOrderOnPeriod,
292        Date startDateTime,
293        Date endDateTime,
294        Boolean isMainOperation,
295        LineString position,
296        String comments,
297        Date controlDate,
298        Date validationDate,
299        Date qualificationDate,
300        String qualificationComments);
301
302    /**
303     * <p>
304     * Does the same thing as {@link #create(Date, Date, Boolean, String, Short, Date, Date, Boolean, LineString, String, Date, Date, Date, String)} 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
312     * @param fishingStartDateTime Date/heure au début du prélèvement.
313Par exemple, pour le cas d'une opération avec un chalut, il s'agit la date/heure à l'établissement
314du chalut (le temps de descente n'est pas pris en compte).
315     * @param fishingEndDateTime Date/heure à la fin du prélèvement.
316Par exemple, pour le cas d'une opération avec un chalut, le temps de remontée n'est pas
317comptabilisé.
318     * @param hasCatch Une capture a t elle été prélevée ?
319Si non, il s'agit d'une opération de peche infructueuse.
320A priori, si une capture avec quantification différente de 0 est saisie, ou bien si des produits
321sont rattachés à l'opération, alors hasCatch=true (HAS_CATCH=1).
322Si on ne sait pas si une capture a été réalisée ou non, le champ est laissé vide.
323Champ utile pour les marées observées au débarquement, pour lesquelles on ne peut pas saisir
324systématiquement de lot capture ou bien des produits.
325     * @param name @deprecated - NE PLUS UTILISER
326Libellé de l'opération.
327REMARQUE : attribut absent des IHM. Présent pour les données historiques. Sans doute à supprimer
328dans l'avenir.
329     * @param rankOrderOnPeriod Rang (de présentation) de l'opération, sur la période date début/fin.
330ATTENTION : Lorsque plusieurs opérations sont présentes sur la meme période, cela permet de les
331dissocier.
332C'est par exemple le cas des séquences de peches (opérations agrégées en Jour/Métier/Secteur) :
333plusieurs opérations peuvent etre sur le meme jour (avec des engin/secteur différents), il faut donc
334leur attribuer un rang, pour les distinguer. Ce rang peut etre celui de la déclaration du pecheur
335(ordre de saisie), ou bien un ordre quelconque.
336Dans Allegro, ce rang sera utilisé pour ordonner ces opérations entre elles, dans les listes qui les
337représentent. S'il est absent, seule la date de début est utilisée pour cela.
338     * @param startDateTime Date/heure de début de l'opération
339     * @param endDateTime Date/heure de fin de l'opération
340     * @param isMainOperation <html>
341<head>
342<style>
343p {padding:0px; margin:0px;}
344</style>
345</head>
346<body>
347<p>
348Indique s'il s'agit d'une opération ou d'un groupe d'opérations &quot;principal&quot;.
349</p>
350<p>
351Cela est utilisé notamment quand on ne connait que l'activité principale (le métier) d'un navire. On
352parle alors de métrier principal.
353<br>
354</p>
355<p>
356&#160;
357</p>
358<p>
359Généralement, cet atrribut est utilisé pour des groupes d'opérations (<i>rankOrderOnPerod is not
360null</i>), pour identifier sur la marée ou une journée de peche, le groupe d'opération portant le
361métier principal de la marée ou de la journée.
362</p>
363</body>
364</html>
365     * @param position Géométrie de l'opération.
366Ce champ est optionnel pour etre compatible avec uDIG/geotools.
367     * @param comments 
368     * @param controlDate 
369     * @param validationDate 
370     * @param qualificationDate 
371     * @param qualificationComments 
372     * @return FishingOperation
373     */
374    public Object create(
375        int transform,
376        Date fishingStartDateTime,
377        Date fishingEndDateTime,
378        Boolean hasCatch,
379        String name,
380        Short rankOrderOnPeriod,
381        Date startDateTime,
382        Date endDateTime,
383        Boolean isMainOperation,
384        LineString position,
385        String comments,
386        Date controlDate,
387        Date validationDate,
388        Date qualificationDate,
389        String qualificationComments);
390
391    /**
392     * <p>
393     * Creates a new <code>FishingOperation</code>
394     * instance from only <strong>required</strong> properties (attributes
395     * and association ends) and adds it to the persistent store.
396     * </p>
397     * @param qualityFlag
398     * @param vessel
399     * @return FishingOperation
400     */
401    public FishingOperation create(
402        QualityFlag qualityFlag,
403        Vessel vessel);
404
405    /**
406     * <p>
407     * Does the same thing as {@link #create()} with an
408     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
409     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
410     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
411     * transform the entity (into a value object for example). By default, transformation does
412     * not occur.
413     * </p>
414     * @param transform flag to determine transformation type.
415     * @param qualityFlag
416     * @param vessel
417     * @return Object
418     */
419    public Object create(
420        int transform,
421        QualityFlag qualityFlag,
422        Vessel vessel);
423
424    /**
425     * Updates the <code>fishingOperation</code> instance in the persistent store.
426     * @param fishingOperation
427     */
428    public void update(FishingOperation fishingOperation);
429
430    /**
431     * Updates all instances in the <code>entities</code> collection in the persistent store.
432     * @param entities
433     */
434    public void update(Collection<FishingOperation> entities);
435
436    /**
437     * Removes the instance of FishingOperation from the persistent store.
438     * @param fishingOperation
439     */
440    public void remove(FishingOperation fishingOperation);
441
442    /**
443     * Removes the instance of FishingOperation having the given
444     * <code>identifier</code> from the persistent store.
445     * @param id
446     */
447    public void remove(Integer id);
448
449    /**
450     * Removes all entities in the given <code>entities</code> collection.
451     * @param entities
452     */
453    public void remove(Collection<FishingOperation> entities);
454
455
456    /**
457     * Does the same thing as {@link #search(int, Search)} but with an
458     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
459     * limit your data to a specified page number and size.
460     *
461     * @param transform the transformation flag.
462     * @param pageNumber the page number in the data to retrieve
463     * @param pageSize the size of the page to retrieve.
464     * @param search the search object which provides the search parameters and pagination specification.
465     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
466     */
467    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
468
469    /**
470     * Does the same thing as {@link #search(Search)} but with an
471     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
472     * limit your data to a specified page number and size.
473     *
474     * @param pageNumber the page number in the data to retrieve
475     * @param pageSize the size of the page to retrieve.
476     * @param search the search object which provides the search parameters and pagination specification.
477     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
478     */
479    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
480
481    /**
482     * Does the same thing as {@link #search(Search)} but with an
483     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
484     * finder results will <strong>NOT</strong> be transformed during retrieval.
485     * If this flag is any of the other constants defined here
486     * then results <strong>WILL BE</strong> passed through an operation which can optionally
487     * transform the entities (into value objects for example). By default, transformation does
488     * not occur.
489     *
490     * @param transform the transformation flag.
491     * @param search the search object which provides the search parameters and pagination specification.
492     * @return any found results from the search.
493     */
494    public Set<?> search(final int transform, final Search search);
495
496    /**
497     * Performs a search using the parameters specified in the given <code>search</code> object.
498     *
499     * @param search the search object which provides the search parameters and pagination specification.
500     * @return any found results from the search.
501     */
502    public Set<FishingOperation> search(final Search search);
503
504    /**
505     * Allows transformation of entities into value objects
506     * (or something else for that matter), when the <code>transform</code>
507     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.data.operation.FishingOperationDao</code>, please note
508     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
509     * will be returned.
510     *
511     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
512     *
513     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.data.operation.FishingOperationDao}
514     * @param entity an entity that was found
515     * @return the transformed entity (i.e. new value object, etc)
516     * @see #transformEntities(int,Collection)
517     */
518    public Object transformEntity(final int transform, final FishingOperation entity);
519
520    /**
521     * Transforms a collection of entities using the
522     * {@link #transformEntity(int,FishingOperation)}
523     * method. This method does not instantiate a new collection.
524     * <p>
525     * This method is to be used internally only.
526     *
527     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.data.operation.FishingOperationDao</code>
528     * @param entities the collection of entities to transform
529     * @see #transformEntity(int,FishingOperation)
530     */
531    public void transformEntities(final int transform, final Collection<?> entities);
532
533    // spring-dao merge-point
534}