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.referential.pmfm;
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.Status;
033import java.sql.Timestamp;
034import java.util.Collection;
035import java.util.Set;
036import org.andromda.spring.PaginationResult;
037
038/**
039 * Niveau (ou période) d'agrégation de la donnée.
040 * Par exemple :
041 * - aucune (pas d'agrégation)
042 * - jour,
043 * - mois,
044 * - année
045 * - marée
046 * - opération
047 * - zone de peche (cas des séquences de peche ?)
048 * Utiliser une période d'agrégation permet de définir des valeurs moyennes sur une période
049 * d'agrégation (par exemple : le mois) indépendamment de la période concernée (par exemple : une
050 * année).
051 * Exemple :
052 * - moyenne mensuelle sur l'année, du nombre d'engin levé par jour :
053 * - paramètre : nombre d'engin levé
054 * - niveau d'agrégation du PSFM : jour
055 * - période concerné : 01/01/XX au 31/12/XX : définie au niveau de l'entité à laquelle est
056 * rattachée la mesure (exemple : la marée, l'opération, les caractéristiques d'utilisation, etc.).
057 * - période d'agrégation sur la mesure (xxxMeasurement) : mois
058 * @see AggregationLevel
059 */
060public interface AggregationLevelDao
061{
062    /**
063     * This constant is used as a transformation flag; entities can be converted automatically into value objects
064     * or other types, different methods in a class implementing this interface support this feature: look for
065     * an <code>int</code> parameter called <code>transform</code>.
066     * <p>
067     * This specific flag denotes no transformation will occur.
068     */
069    public static final int TRANSFORM_NONE = 0;
070
071
072    /**
073     * Transforms the given results to a collection of {@link AggregationLevel}
074     * instances (this is useful when the returned results contains a row of data and you want just entities only).
075     *
076     * @param results the query results.
077     */
078    public void toEntities(final Collection<?> results);
079
080    /**
081     * Gets an instance of AggregationLevel from the persistent store.
082     * @param id
083     * @return AggregationLevel
084     */
085    public AggregationLevel get(Integer id);
086
087    /**
088     * <p>
089     * Does the same thing as {@link #get(Integer)} with an
090     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
091     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
092     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
093     * optionally transform the entity (into a value object for example). By default, transformation does
094     * not occur.
095     * </p>
096     *
097     * @param transform flag to determine transformation type.
098     * @param id the identifier of the entity to get.
099     * @return either the entity or the object transformed from the entity.
100     */
101    public Object get(int transform, Integer id);
102
103    /**
104     * Loads an instance of AggregationLevel from the persistent store.
105     * @param id
106     * @return AggregationLevel
107     */
108    public AggregationLevel load(Integer id);
109
110    /**
111     * <p>
112     * Does the same thing as {@link #load(Integer)} with an
113     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
114     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
115     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
116     * optionally transform the entity (into a value object for example). By default, transformation does
117     * not occur.
118     * </p>
119     *
120     * @param transform flag to determine transformation type.
121     * @param id the identifier of the entity to load.
122     * @return either the entity or the object transformed from the entity.
123     */
124    public Object load(int transform, Integer id);
125
126    /**
127     * Loads all entities of type {@link AggregationLevel}.
128     *
129     * @return the loaded entities.
130     */
131    public Collection<AggregationLevel> loadAll();
132
133    /**
134     * <p>
135     * Does the same thing as {@link #loadAll()} with an
136     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
137     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
138     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
139     * transform the entity (into a value object for example). By default, transformation does
140     * not occur.
141     * </p>
142     *
143     * @param transform the flag indicating what transformation to use.
144     * @return the loaded entities.
145     */
146    public Collection<?> loadAll(final int transform);
147
148    /**
149     * <p>
150     * Does the same thing as {@link #loadAll()} with an
151     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
152     * 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
153     * page retrieved.
154     * </p>
155     *
156     * @param pageNumber the page number to retrieve when paging results.
157     * @param pageSize the size of the page to retrieve when paging results.
158     * @return the loaded entities.
159     */
160    public Collection<?> loadAll(final int pageNumber, final int pageSize);
161
162    /**
163     * <p>
164     * Does the same thing as {@link #loadAll(int)} 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 transform the flag indicating what transformation to use.
171     * @param pageNumber the page number to retrieve when paging results.
172     * @param pageSize the size of the page to retrieve when paging results.
173     * @return the loaded entities.
174     */
175    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
176
177    /**
178     * Creates an instance of AggregationLevel and adds it to the persistent store.
179     * @param aggregationLevel
180     * @return AggregationLevel
181     */
182    public AggregationLevel create(AggregationLevel aggregationLevel);
183
184    /**
185     * <p>
186     * Does the same thing as {@link #create(AggregationLevel)} with an
187     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
188     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
189     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
190     * transform the entity (into a value object for example). By default, transformation does
191     * not occur.
192     * </p>
193     * @param transform
194     * @param aggregationLevel
195     * @return Object
196     */
197    public Object create(int transform, AggregationLevel aggregationLevel);
198
199    /**
200     * Creates a new instance of AggregationLevel and adds
201     * from the passed in <code>entities</code> collection
202     *
203     * @param entities the collection of AggregationLevel
204     * instances to create.
205     *
206     * @return the created instances.
207     */
208    public Collection<AggregationLevel> create(Collection<AggregationLevel> entities);
209
210    /**
211     * <p>
212     * Does the same thing as {@link #create(AggregationLevel)} with an
213     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
214     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
215     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
216     * transform the entities (into value objects for example). By default, transformation does
217     * not occur.
218     * </p>
219     * @param transform
220     * @param entities
221     * @return Collection
222     */
223    public Collection<?> create(int transform, Collection<AggregationLevel> entities);
224
225    /**
226     * <p>
227     * Creates a new <code>AggregationLevel</code>
228     * instance from <strong>all</strong> attributes and adds it to
229     * the persistent store.
230     * </p>
231     * @param name 
232     * @param rankOrder rang permettant de classer les niveau d'agrégation par ordre de précision : le niveau le plus bas
233est 'aucune' (donnée brute), le niveau le plus haut pourrait etre 'année' (moyenne annuelle)
234     * @param updateDate 
235     * @param comments 
236     * @return AggregationLevel
237     */
238    public AggregationLevel create(
239        String name,
240        Integer rankOrder,
241        Timestamp updateDate,
242        String comments);
243
244    /**
245     * <p>
246     * Does the same thing as {@link #create(String, Integer, Timestamp, String)} with an
247     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
248     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
249     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
250     * transform the entity (into a value object for example). By default, transformation does
251     * not occur.
252     * </p>
253     * @param transform
254     * @param name 
255     * @param rankOrder rang permettant de classer les niveau d'agrégation par ordre de précision : le niveau le plus bas
256est 'aucune' (donnée brute), le niveau le plus haut pourrait etre 'année' (moyenne annuelle)
257     * @param updateDate 
258     * @param comments 
259     * @return AggregationLevel
260     */
261    public Object create(
262        int transform,
263        String name,
264        Integer rankOrder,
265        Timestamp updateDate,
266        String comments);
267
268    /**
269     * <p>
270     * Creates a new <code>AggregationLevel</code>
271     * instance from only <strong>required</strong> properties (attributes
272     * and association ends) and adds it to the persistent store.
273     * </p>
274     * @param name
275     * @param rankOrder
276     * @param status
277     * @param updateDate
278     * @return AggregationLevel
279     */
280    public AggregationLevel create(
281        String name,
282        Integer rankOrder,
283        Status status,
284        Timestamp updateDate);
285
286    /**
287     * <p>
288     * Does the same thing as {@link #create(String, Integer, Timestamp)} with an
289     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
290     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
291     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
292     * transform the entity (into a value object for example). By default, transformation does
293     * not occur.
294     * </p>
295     * @param transform flag to determine transformation type.
296     * @param name
297     * @param rankOrder
298     * @param status
299     * @param updateDate
300     * @return Object
301     */
302    public Object create(
303        int transform,
304        String name,
305        Integer rankOrder,
306        Status status,
307        Timestamp updateDate);
308
309    /**
310     * Updates the <code>aggregationLevel</code> instance in the persistent store.
311     * @param aggregationLevel
312     */
313    public void update(AggregationLevel aggregationLevel);
314
315    /**
316     * Updates all instances in the <code>entities</code> collection in the persistent store.
317     * @param entities
318     */
319    public void update(Collection<AggregationLevel> entities);
320
321    /**
322     * Removes the instance of AggregationLevel from the persistent store.
323     * @param aggregationLevel
324     */
325    public void remove(AggregationLevel aggregationLevel);
326
327    /**
328     * Removes the instance of AggregationLevel having the given
329     * <code>identifier</code> from the persistent store.
330     * @param id
331     */
332    public void remove(Integer id);
333
334    /**
335     * Removes all entities in the given <code>entities</code> collection.
336     * @param entities
337     */
338    public void remove(Collection<AggregationLevel> entities);
339
340
341    /**
342     * Does the same thing as {@link #search(int, Search)} but with an
343     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
344     * limit your data to a specified page number and size.
345     *
346     * @param transform the transformation flag.
347     * @param pageNumber the page number in the data to retrieve
348     * @param pageSize the size of the page to retrieve.
349     * @param search the search object which provides the search parameters and pagination specification.
350     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
351     */
352    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
353
354    /**
355     * Does the same thing as {@link #search(Search)} but with an
356     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
357     * limit your data to a specified page number and size.
358     *
359     * @param pageNumber the page number in the data to retrieve
360     * @param pageSize the size of the page to retrieve.
361     * @param search the search object which provides the search parameters and pagination specification.
362     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
363     */
364    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
365
366    /**
367     * Does the same thing as {@link #search(Search)} but with an
368     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
369     * finder results will <strong>NOT</strong> be transformed during retrieval.
370     * If this flag is any of the other constants defined here
371     * then results <strong>WILL BE</strong> passed through an operation which can optionally
372     * transform the entities (into value objects for example). By default, transformation does
373     * not occur.
374     *
375     * @param transform the transformation flag.
376     * @param search the search object which provides the search parameters and pagination specification.
377     * @return any found results from the search.
378     */
379    public Set<?> search(final int transform, final Search search);
380
381    /**
382     * Performs a search using the parameters specified in the given <code>search</code> object.
383     *
384     * @param search the search object which provides the search parameters and pagination specification.
385     * @return any found results from the search.
386     */
387    public Set<AggregationLevel> search(final Search search);
388
389    /**
390     * Allows transformation of entities into value objects
391     * (or something else for that matter), when the <code>transform</code>
392     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.pmfm.AggregationLevelDao</code>, please note
393     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
394     * will be returned.
395     *
396     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
397     *
398     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.pmfm.AggregationLevelDao}
399     * @param entity an entity that was found
400     * @return the transformed entity (i.e. new value object, etc)
401     * @see #transformEntities(int,Collection)
402     */
403    public Object transformEntity(final int transform, final AggregationLevel entity);
404
405    /**
406     * Transforms a collection of entities using the
407     * {@link #transformEntity(int,AggregationLevel)}
408     * method. This method does not instantiate a new collection.
409     * <p>
410     * This method is to be used internally only.
411     *
412     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.pmfm.AggregationLevelDao</code>
413     * @param entities the collection of entities to transform
414     * @see #transformEntity(int,AggregationLevel)
415     */
416    public void transformEntities(final int transform, final Collection<?> entities);
417
418    // spring-dao merge-point
419}