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.fishingArea;
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.DistanceToCoastGradient;
033import fr.ifremer.adagio.core.dao.referential.QualityFlag;
034import fr.ifremer.adagio.core.dao.referential.location.Location;
035import java.util.Collection;
036import java.util.Date;
037import java.util.Set;
038import org.andromda.spring.PaginationResult;
039
040/**
041 * <html>
042 * <head>
043 * <style>
044 * p {padding:0px; margin:0px;}
045 * </style>
046 * </head>
047 * <body>
048 * <p>
049 * Zone de peche ou d'activité effective d'un navire.
050 * </p>
051 * <p>
052 * </p>
053 * <p>
054 * Contient une entrée pour chaque zone de peche d'un navire.
055 * </p>
056 * <p>
057 * </p>
058 * <p>
059 * ATTENTION : ne pas réutiliser une zone de peche effective dèjà
060 * existante, à cause des liens de composition (et des contraintes &quot;delete
061 * cascade&quot;) depuis les autres tables.
062 * </p>
063 * <p>
064 * Votre enregistrement pourrait etre supprimée par quelqu'un d'autre !
065 * </p>
066 * <p>
067 * </p>
068 * <p>
069 * </p>
070 * <p>
071 * <u>Cas particulier des campagnes scientifiques (F.Coppin) : </u>Dans le
072 * cas des campagnes scientifiques, ce concept correspond à une &quot;station&quot;. La
073 * notion exacte de Fishing Area est définie suivant le protocole spatiale
074 * mise en place. En effet, la notion la plus fine d'aire de travail est la
075 * localité (stockée  <i>FishingArea2RegulationLocation</i>).
076 * L'ordre de réalisation des prélèvements pouvant changer d'une année sur
077 * l'autre, la localité permet de disposer d'un code unique pour une zone
078 * de prélèvement donnée. Cette localité peut s'inscrire ou non selon le
079 * protocole dans une strate (stcokée dans <i>FishingArea2RegulationLocation)</i>
080 * définie dans le cadre du programme lié à la série (ce paramétrage est
081 * stocké dans les <i>Program</i> et <i>Strategy</i>). Il s'agit alors
082 * d'un 2ème niveau géographique pouvant contenir une ou plusieurs
083 * localités.
084 * </p>
085 * <p>
086 * Toutes les situations peuvent être envisagées :
087 * </p>
088 * <ul>
089 * <li>
090 * Localités + strates
091 * </li>
092 * <li>
093 * Localités sans strate
094 * </li>
095 * <li>
096 * Strates sans localité
097 * </li>
098 * <li>
099 * ni localité ni strate
100 * </li>
101 * </ul>
102 * <p>
103 * En plus de ces options la notion de strate bathymétrique peut exister.
104 * </p>
105 * <p>
106 * Dans tous les cas de figure ces divers éléments géographiques doivent
107 * s'inscrivent dans la notion officielle de rectangle ou sous rectangle
108 * statistique (stcoké dans <i>FishingArea.location</i>).
109 * </p>
110 * <p>
111 * </p>
112 * </body>
113 * </html>
114 * @see FishingArea
115 */
116public interface FishingAreaDao
117{
118    /**
119     * This constant is used as a transformation flag; entities can be converted automatically into value objects
120     * or other types, different methods in a class implementing this interface support this feature: look for
121     * an <code>int</code> parameter called <code>transform</code>.
122     * <p>
123     * This specific flag denotes no transformation will occur.
124     */
125    public static final int TRANSFORM_NONE = 0;
126
127
128    /**
129     * Transforms the given results to a collection of {@link FishingArea}
130     * instances (this is useful when the returned results contains a row of data and you want just entities only).
131     *
132     * @param results the query results.
133     */
134    public void toEntities(final Collection<?> results);
135
136    /**
137     * Gets an instance of FishingArea from the persistent store.
138     * @param id
139     * @return FishingArea
140     */
141    public FishingArea get(Integer id);
142
143    /**
144     * <p>
145     * Does the same thing as {@link #get(Integer)} with an
146     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
147     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
148     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
149     * optionally transform the entity (into a value object for example). By default, transformation does
150     * not occur.
151     * </p>
152     *
153     * @param transform flag to determine transformation type.
154     * @param id the identifier of the entity to get.
155     * @return either the entity or the object transformed from the entity.
156     */
157    public Object get(int transform, Integer id);
158
159    /**
160     * Loads an instance of FishingArea from the persistent store.
161     * @param id
162     * @return FishingArea
163     */
164    public FishingArea load(Integer id);
165
166    /**
167     * <p>
168     * Does the same thing as {@link #load(Integer)} with an
169     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
170     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
171     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
172     * optionally transform the entity (into a value object for example). By default, transformation does
173     * not occur.
174     * </p>
175     *
176     * @param transform flag to determine transformation type.
177     * @param id the identifier of the entity to load.
178     * @return either the entity or the object transformed from the entity.
179     */
180    public Object load(int transform, Integer id);
181
182    /**
183     * Loads all entities of type {@link FishingArea}.
184     *
185     * @return the loaded entities.
186     */
187    public Collection<FishingArea> loadAll();
188
189    /**
190     * <p>
191     * Does the same thing as {@link #loadAll()} with an
192     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
193     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
194     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
195     * transform the entity (into a value object for example). By default, transformation does
196     * not occur.
197     * </p>
198     *
199     * @param transform the flag indicating what transformation to use.
200     * @return the loaded entities.
201     */
202    public Collection<?> loadAll(final int transform);
203
204    /**
205     * <p>
206     * Does the same thing as {@link #loadAll()} with an
207     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
208     * 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
209     * page retrieved.
210     * </p>
211     *
212     * @param pageNumber the page number to retrieve when paging results.
213     * @param pageSize the size of the page to retrieve when paging results.
214     * @return the loaded entities.
215     */
216    public Collection<?> loadAll(final int pageNumber, final int pageSize);
217
218    /**
219     * <p>
220     * Does the same thing as {@link #loadAll(int)} with an
221     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
222     * 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
223     * page retrieved.
224     * </p>
225     *
226     * @param transform the flag indicating what transformation to use.
227     * @param pageNumber the page number to retrieve when paging results.
228     * @param pageSize the size of the page to retrieve when paging results.
229     * @return the loaded entities.
230     */
231    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
232
233    /**
234     * Creates an instance of FishingArea and adds it to the persistent store.
235     * @param fishingArea
236     * @return FishingArea
237     */
238    public FishingArea create(FishingArea fishingArea);
239
240    /**
241     * <p>
242     * Does the same thing as {@link #create(FishingArea)} with an
243     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
244     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
245     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
246     * transform the entity (into a value object for example). By default, transformation does
247     * not occur.
248     * </p>
249     * @param transform
250     * @param fishingArea
251     * @return Object
252     */
253    public Object create(int transform, FishingArea fishingArea);
254
255    /**
256     * Creates a new instance of FishingArea and adds
257     * from the passed in <code>entities</code> collection
258     *
259     * @param entities the collection of FishingArea
260     * instances to create.
261     *
262     * @return the created instances.
263     */
264    public Collection<FishingArea> create(Collection<FishingArea> entities);
265
266    /**
267     * <p>
268     * Does the same thing as {@link #create(FishingArea)} with an
269     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
270     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
271     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
272     * transform the entities (into value objects for example). By default, transformation does
273     * not occur.
274     * </p>
275     * @param transform
276     * @param entities
277     * @return Collection
278     */
279    public Collection<?> create(int transform, Collection<FishingArea> entities);
280
281    /**
282     * <p>
283     * Creates a new <code>FishingArea</code>
284     * instance from <strong>all</strong> attributes and adds it to
285     * the persistent store.
286     * </p>
287     * @param qualificationDate @since 3.5.0
288     * @param qualificationComments @since 3.5.0
289     * @return FishingArea
290     */
291    public FishingArea create(
292        Date qualificationDate,
293        String qualificationComments);
294
295    /**
296     * <p>
297     * Does the same thing as {@link #create(Date, String)} with an
298     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
299     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
300     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
301     * transform the entity (into a value object for example). By default, transformation does
302     * not occur.
303     * </p>
304     * @param transform
305     * @param qualificationDate @since 3.5.0
306     * @param qualificationComments @since 3.5.0
307     * @return FishingArea
308     */
309    public Object create(
310        int transform,
311        Date qualificationDate,
312        String qualificationComments);
313
314    /**
315     * <p>
316     * Creates a new <code>FishingArea</code>
317     * instance from only <strong>required</strong> properties (attributes
318     * and association ends) and adds it to the persistent store.
319     * </p>
320     * @param distanceToCoastGradient
321     * @param location
322     * @param qualityFlag
323     * @return FishingArea
324     */
325    public FishingArea create(
326        DistanceToCoastGradient distanceToCoastGradient,
327        Location location,
328        QualityFlag qualityFlag);
329
330    /**
331     * <p>
332     * Does the same thing as {@link #create()} with an
333     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
334     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
335     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
336     * transform the entity (into a value object for example). By default, transformation does
337     * not occur.
338     * </p>
339     * @param transform flag to determine transformation type.
340     * @param distanceToCoastGradient
341     * @param location
342     * @param qualityFlag
343     * @return Object
344     */
345    public Object create(
346        int transform,
347        DistanceToCoastGradient distanceToCoastGradient,
348        Location location,
349        QualityFlag qualityFlag);
350
351    /**
352     * Updates the <code>fishingArea</code> instance in the persistent store.
353     * @param fishingArea
354     */
355    public void update(FishingArea fishingArea);
356
357    /**
358     * Updates all instances in the <code>entities</code> collection in the persistent store.
359     * @param entities
360     */
361    public void update(Collection<FishingArea> entities);
362
363    /**
364     * Removes the instance of FishingArea from the persistent store.
365     * @param fishingArea
366     */
367    public void remove(FishingArea fishingArea);
368
369    /**
370     * Removes the instance of FishingArea having the given
371     * <code>identifier</code> from the persistent store.
372     * @param id
373     */
374    public void remove(Integer id);
375
376    /**
377     * Removes all entities in the given <code>entities</code> collection.
378     * @param entities
379     */
380    public void remove(Collection<FishingArea> entities);
381
382
383    /**
384     * Does the same thing as {@link #search(int, Search)} but with an
385     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
386     * limit your data to a specified page number and size.
387     *
388     * @param transform the transformation flag.
389     * @param pageNumber the page number in the data to retrieve
390     * @param pageSize the size of the page to retrieve.
391     * @param search the search object which provides the search parameters and pagination specification.
392     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
393     */
394    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
395
396    /**
397     * Does the same thing as {@link #search(Search)} but with an
398     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
399     * limit your data to a specified page number and size.
400     *
401     * @param pageNumber the page number in the data to retrieve
402     * @param pageSize the size of the page to retrieve.
403     * @param search the search object which provides the search parameters and pagination specification.
404     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
405     */
406    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
407
408    /**
409     * Does the same thing as {@link #search(Search)} but with an
410     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
411     * finder results will <strong>NOT</strong> be transformed during retrieval.
412     * If this flag is any of the other constants defined here
413     * then results <strong>WILL BE</strong> passed through an operation which can optionally
414     * transform the entities (into value objects for example). By default, transformation does
415     * not occur.
416     *
417     * @param transform the transformation flag.
418     * @param search the search object which provides the search parameters and pagination specification.
419     * @return any found results from the search.
420     */
421    public Set<?> search(final int transform, final Search search);
422
423    /**
424     * Performs a search using the parameters specified in the given <code>search</code> object.
425     *
426     * @param search the search object which provides the search parameters and pagination specification.
427     * @return any found results from the search.
428     */
429    public Set<FishingArea> search(final Search search);
430
431    /**
432     * Allows transformation of entities into value objects
433     * (or something else for that matter), when the <code>transform</code>
434     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.data.fishingArea.FishingAreaDao</code>, please note
435     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
436     * will be returned.
437     *
438     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
439     *
440     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.data.fishingArea.FishingAreaDao}
441     * @param entity an entity that was found
442     * @return the transformed entity (i.e. new value object, etc)
443     * @see #transformEntities(int,Collection)
444     */
445    public Object transformEntity(final int transform, final FishingArea entity);
446
447    /**
448     * Transforms a collection of entities using the
449     * {@link #transformEntity(int,FishingArea)}
450     * method. This method does not instantiate a new collection.
451     * <p>
452     * This method is to be used internally only.
453     *
454     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.data.fishingArea.FishingAreaDao</code>
455     * @param entities the collection of entities to transform
456     * @see #transformEntity(int,FishingArea)
457     */
458    public void transformEntities(final int transform, final Collection<?> entities);
459
460    // spring-dao merge-point
461}