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