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