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