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.grouping;
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 java.util.Collection;
033import java.util.Set;
034import org.andromda.spring.PaginationResult;
035
036/**
037 * <html>
038 * <head>
039 * <style>
040 * p {padding:0px; margin:0px;}
041 * </style>
042 * </head>
043 * <body>
044 * <p>
045 * <i>GroupingItem</i> permet de lister les entités du référentiel qui
046 * appartiennent à un regroupement.
047 * </p>
048 * </body>
049 * </html>
050 * @see GroupingItem
051 */
052public interface GroupingItemDao
053{
054    /**
055     * This constant is used as a transformation flag; entities can be converted automatically into value objects
056     * or other types, different methods in a class implementing this interface support this feature: look for
057     * an <code>int</code> parameter called <code>transform</code>.
058     * <p>
059     * This specific flag denotes no transformation will occur.
060     */
061    public static final int TRANSFORM_NONE = 0;
062
063
064    /**
065     * Transforms the given results to a collection of {@link GroupingItem}
066     * instances (this is useful when the returned results contains a row of data and you want just entities only).
067     *
068     * @param results the query results.
069     */
070    public void toEntities(final Collection<?> results);
071
072    /**
073     * Gets an instance of GroupingItem from the persistent store.
074     * @param id
075     * @return GroupingItem
076     */
077    public GroupingItem get(Integer id);
078
079    /**
080     * <p>
081     * Does the same thing as {@link #get(Integer)} with an
082     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
083     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
084     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
085     * optionally transform the entity (into a value object for example). By default, transformation does
086     * not occur.
087     * </p>
088     *
089     * @param transform flag to determine transformation type.
090     * @param id the identifier of the entity to get.
091     * @return either the entity or the object transformed from the entity.
092     */
093    public Object get(int transform, Integer id);
094
095    /**
096     * Loads an instance of GroupingItem from the persistent store.
097     * @param id
098     * @return GroupingItem
099     */
100    public GroupingItem load(Integer id);
101
102    /**
103     * <p>
104     * Does the same thing as {@link #load(Integer)} with an
105     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
106     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
107     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
108     * optionally transform the entity (into a value object for example). By default, transformation does
109     * not occur.
110     * </p>
111     *
112     * @param transform flag to determine transformation type.
113     * @param id the identifier of the entity to load.
114     * @return either the entity or the object transformed from the entity.
115     */
116    public Object load(int transform, Integer id);
117
118    /**
119     * Loads all entities of type {@link GroupingItem}.
120     *
121     * @return the loaded entities.
122     */
123    public Collection<GroupingItem> loadAll();
124
125    /**
126     * <p>
127     * Does the same thing as {@link #loadAll()} with an
128     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
129     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
130     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
131     * transform the entity (into a value object for example). By default, transformation does
132     * not occur.
133     * </p>
134     *
135     * @param transform the flag indicating what transformation to use.
136     * @return the loaded entities.
137     */
138    public Collection<?> loadAll(final int transform);
139
140    /**
141     * <p>
142     * Does the same thing as {@link #loadAll()} with an
143     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
144     * 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
145     * page retrieved.
146     * </p>
147     *
148     * @param pageNumber the page number to retrieve when paging results.
149     * @param pageSize the size of the page to retrieve when paging results.
150     * @return the loaded entities.
151     */
152    public Collection<?> loadAll(final int pageNumber, final int pageSize);
153
154    /**
155     * <p>
156     * Does the same thing as {@link #loadAll(int)} with an
157     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
158     * 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
159     * page retrieved.
160     * </p>
161     *
162     * @param transform the flag indicating what transformation to use.
163     * @param pageNumber the page number to retrieve when paging results.
164     * @param pageSize the size of the page to retrieve when paging results.
165     * @return the loaded entities.
166     */
167    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
168
169    /**
170     * Creates an instance of GroupingItem and adds it to the persistent store.
171     * @param groupingItem
172     * @return GroupingItem
173     */
174    public GroupingItem create(GroupingItem groupingItem);
175
176    /**
177     * <p>
178     * Does the same thing as {@link #create(GroupingItem)} with an
179     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
180     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
181     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
182     * transform the entity (into a value object for example). By default, transformation does
183     * not occur.
184     * </p>
185     * @param transform
186     * @param groupingItem
187     * @return Object
188     */
189    public Object create(int transform, GroupingItem groupingItem);
190
191    /**
192     * Creates a new instance of GroupingItem and adds
193     * from the passed in <code>entities</code> collection
194     *
195     * @param entities the collection of GroupingItem
196     * instances to create.
197     *
198     * @return the created instances.
199     */
200    public Collection<GroupingItem> create(Collection<GroupingItem> entities);
201
202    /**
203     * <p>
204     * Does the same thing as {@link #create(GroupingItem)} with an
205     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
206     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
207     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
208     * transform the entities (into value objects for example). By default, transformation does
209     * not occur.
210     * </p>
211     * @param transform
212     * @param entities
213     * @return Collection
214     */
215    public Collection<?> create(int transform, Collection<GroupingItem> entities);
216
217    /**
218     * <p>
219     * Creates a new <code>GroupingItem</code>
220     * instance from <strong>all</strong> attributes and adds it to
221     * the persistent store.
222     * </p>
223     * @param objectId <html>
224<head>
225<style>
226p {padding:0px; margin:0px;}
227</style>
228</head>
229<body>
230<p>
231<i>objectId</i> permet de stocker l’identifiant de l’entité, sachant que
232la table pointée doit correspondre au type d’entité de la classification
233de regroupement (cf <i>GroupingClassification.objectType</i>)
234</p>
235</body>
236</html>
237     * @param objectCode 
238     * @param comments 
239     * @return GroupingItem
240     */
241    public GroupingItem create(
242        Integer objectId,
243        String objectCode,
244        String comments);
245
246    /**
247     * <p>
248     * Does the same thing as {@link #create(Integer, String, String)} with an
249     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
250     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
251     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
252     * transform the entity (into a value object for example). By default, transformation does
253     * not occur.
254     * </p>
255     * @param transform
256     * @param objectId <html>
257<head>
258<style>
259p {padding:0px; margin:0px;}
260</style>
261</head>
262<body>
263<p>
264<i>objectId</i> permet de stocker l’identifiant de l’entité, sachant que
265la table pointée doit correspondre au type d’entité de la classification
266de regroupement (cf <i>GroupingClassification.objectType</i>)
267</p>
268</body>
269</html>
270     * @param objectCode 
271     * @param comments 
272     * @return GroupingItem
273     */
274    public Object create(
275        int transform,
276        Integer objectId,
277        String objectCode,
278        String comments);
279
280    /**
281     * <p>
282     * Creates a new <code>GroupingItem</code>
283     * instance from only <strong>required</strong> properties (attributes
284     * and association ends) and adds it to the persistent store.
285     * </p>
286     * @param grouping
287     * @return GroupingItem
288     */
289    public GroupingItem create(
290        Grouping grouping);
291
292    /**
293     * <p>
294     * Does the same thing as {@link #create()} with an
295     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
296     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
297     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
298     * transform the entity (into a value object for example). By default, transformation does
299     * not occur.
300     * </p>
301     * @param transform flag to determine transformation type.
302     * @param grouping
303     * @return Object
304     */
305    public Object create(
306        int transform,
307        Grouping grouping);
308
309    /**
310     * Updates the <code>groupingItem</code> instance in the persistent store.
311     * @param groupingItem
312     */
313    public void update(GroupingItem groupingItem);
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<GroupingItem> entities);
320
321    /**
322     * Removes the instance of GroupingItem from the persistent store.
323     * @param groupingItem
324     */
325    public void remove(GroupingItem groupingItem);
326
327    /**
328     * Removes the instance of GroupingItem 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<GroupingItem> 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<GroupingItem> 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.grouping.GroupingItemDao</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.grouping.GroupingItemDao}
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 GroupingItem entity);
404
405    /**
406     * Transforms a collection of entities using the
407     * {@link #transformEntity(int,GroupingItem)}
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.grouping.GroupingItemDao</code>
413     * @param entities the collection of entities to transform
414     * @see #transformEntity(int,GroupingItem)
415     */
416    public void transformEntities(final int transform, final Collection<?> entities);
417
418    // spring-dao merge-point
419}