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.gear;
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 fr.ifremer.adagio.core.dao.referential.ValidityStatus;
034import java.sql.Timestamp;
035import java.util.Collection;
036import java.util.Set;
037import org.andromda.spring.PaginationResult;
038
039/**
040 * <html>
041 * <head>
042 * </head>
043 * <body>
044 * <p>
045 * D&#233;fini un engin, non pas engin physique, mais au sens &quot;classe d'engin&quot;.
046 * </p>
047 * <p>
048 * Il est possible de d&#233;finir un arboresence d'engin, au sein d'une meme
049 * classification, via les liens d'engin parents/enfants.
050 * </p>
051 * <p>
052 * <br>
053 * </p>
054 * <p>
055 * Exemple, pour la classification 'Engin EU corpus' :
056 * </p>
057 * <p>
058 * * 'corpus effort de p&#234;che'<br>- PAL Palangre de surface (Longliner)<br>
059 * </p>
060 * <p>
061 * - EP1 Engins petits p&#233;lagiques - corpus r&#233;glementaire 685/95
062 * </p>
063 * <p>
064 * * corpus 2 (...)<br>- ...
065 * </p>
066 * <p>
067 * <br>
068 * </p>
069 * <p>
070 * Exemple, pour la classification 'FAO/CISTEP' :<br>* 'chaluts' (code
071 * '03.0.0')<br>
072 * </p>
073 * <p>
074 * - 'OTB' 'chalut de fond'<br>
075 * </p>
076 * <p>
077 * - chalut p&#233;lagique
078 * </p>
079 * <p>
080 * - ...<br>* 'Filets'
081 * </p>
082 * </body>
083 * </html>
084 * @see Gear
085 */
086public interface GearDao
087{
088    /**
089     * This constant is used as a transformation flag; entities can be converted automatically into value objects
090     * or other types, different methods in a class implementing this interface support this feature: look for
091     * an <code>int</code> parameter called <code>transform</code>.
092     * <p>
093     * This specific flag denotes no transformation will occur.
094     */
095    public static final int TRANSFORM_NONE = 0;
096
097
098    /**
099     * Transforms the given results to a collection of {@link Gear}
100     * instances (this is useful when the returned results contains a row of data and you want just entities only).
101     *
102     * @param results the query results.
103     */
104    public void toEntities(final Collection<?> results);
105
106    /**
107     * Gets an instance of Gear from the persistent store.
108     * @param id
109     * @return Gear
110     */
111    public Gear get(Integer id);
112
113    /**
114     * <p>
115     * Does the same thing as {@link #get(Integer)} with an
116     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
117     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
118     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
119     * optionally transform the entity (into a value object for example). By default, transformation does
120     * not occur.
121     * </p>
122     *
123     * @param transform flag to determine transformation type.
124     * @param id the identifier of the entity to get.
125     * @return either the entity or the object transformed from the entity.
126     */
127    public Object get(int transform, Integer id);
128
129    /**
130     * Loads an instance of Gear from the persistent store.
131     * @param id
132     * @return Gear
133     */
134    public Gear load(Integer id);
135
136    /**
137     * <p>
138     * Does the same thing as {@link #load(Integer)} with an
139     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
140     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
141     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
142     * optionally transform the entity (into a value object for example). By default, transformation does
143     * not occur.
144     * </p>
145     *
146     * @param transform flag to determine transformation type.
147     * @param id the identifier of the entity to load.
148     * @return either the entity or the object transformed from the entity.
149     */
150    public Object load(int transform, Integer id);
151
152    /**
153     * Loads all entities of type {@link Gear}.
154     *
155     * @return the loaded entities.
156     */
157    public Collection<Gear> loadAll();
158
159    /**
160     * <p>
161     * Does the same thing as {@link #loadAll()} with an
162     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
163     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
164     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
165     * transform the entity (into a value object for example). By default, transformation does
166     * not occur.
167     * </p>
168     *
169     * @param transform the flag indicating what transformation to use.
170     * @return the loaded entities.
171     */
172    public Collection<?> loadAll(final int transform);
173
174    /**
175     * <p>
176     * Does the same thing as {@link #loadAll()} with an
177     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
178     * 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
179     * page retrieved.
180     * </p>
181     *
182     * @param pageNumber the page number to retrieve when paging results.
183     * @param pageSize the size of the page to retrieve when paging results.
184     * @return the loaded entities.
185     */
186    public Collection<?> loadAll(final int pageNumber, final int pageSize);
187
188    /**
189     * <p>
190     * Does the same thing as {@link #loadAll(int)} with an
191     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
192     * 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
193     * page retrieved.
194     * </p>
195     *
196     * @param transform the flag indicating what transformation to use.
197     * @param pageNumber the page number to retrieve when paging results.
198     * @param pageSize the size of the page to retrieve when paging results.
199     * @return the loaded entities.
200     */
201    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
202
203    /**
204     * Creates an instance of Gear and adds it to the persistent store.
205     * @param gear
206     * @return Gear
207     */
208    public Gear create(Gear gear);
209
210    /**
211     * <p>
212     * Does the same thing as {@link #create(Gear)} 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 entity (into a value object for example). By default, transformation does
217     * not occur.
218     * </p>
219     * @param transform
220     * @param gear
221     * @return Object
222     */
223    public Object create(int transform, Gear gear);
224
225    /**
226     * Creates a new instance of Gear and adds
227     * from the passed in <code>entities</code> collection
228     *
229     * @param entities the collection of Gear
230     * instances to create.
231     *
232     * @return the created instances.
233     */
234    public Collection<Gear> create(Collection<Gear> entities);
235
236    /**
237     * <p>
238     * Does the same thing as {@link #create(Gear)} with an
239     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
240     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
241     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
242     * transform the entities (into value objects for example). By default, transformation does
243     * not occur.
244     * </p>
245     * @param transform
246     * @param entities
247     * @return Collection
248     */
249    public Collection<?> create(int transform, Collection<Gear> entities);
250
251    /**
252     * <p>
253     * Creates a new <code>Gear</code>
254     * instance from <strong>all</strong> attributes and adds it to
255     * the persistent store.
256     * </p>
257     * @param label Mnémonique (ou code) de l'engin. Le mnémonique doit être unique pour une meme classification
258d'engin.
259Par exemple : - Pour la classification FAO/CSITEP : label='OTB'
260     * @param name Libellé de l'engin.
261il s'agit du libellé "officiel" de la classification.
262note : ce libellé peut etre régionalisé via "GearLocation".
263     * @param description 
264     * @param updateDate 
265     * @param comments 
266     * @return Gear
267     */
268    public Gear create(
269        String label,
270        String name,
271        String description,
272        Timestamp updateDate,
273        String comments);
274
275    /**
276     * <p>
277     * Does the same thing as {@link #create(String, String, String, Timestamp, String)} with an
278     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
279     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
280     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
281     * transform the entity (into a value object for example). By default, transformation does
282     * not occur.
283     * </p>
284     * @param transform
285     * @param label Mnémonique (ou code) de l'engin. Le mnémonique doit être unique pour une meme classification
286d'engin.
287Par exemple : - Pour la classification FAO/CSITEP : label='OTB'
288     * @param name Libellé de l'engin.
289il s'agit du libellé "officiel" de la classification.
290note : ce libellé peut etre régionalisé via "GearLocation".
291     * @param description 
292     * @param updateDate 
293     * @param comments 
294     * @return Gear
295     */
296    public Object create(
297        int transform,
298        String label,
299        String name,
300        String description,
301        Timestamp updateDate,
302        String comments);
303
304    /**
305     * <p>
306     * Creates a new <code>Gear</code>
307     * instance from only <strong>required</strong> properties (attributes
308     * and association ends) and adds it to the persistent store.
309     * </p>
310     * @param gearClassification
311     * @param label
312     * @param name
313     * @param status
314     * @param updateDate
315     * @param validityStatus
316     * @return Gear
317     */
318    public Gear create(
319        GearClassification gearClassification,
320        String label,
321        String name,
322        Status status,
323        Timestamp updateDate,
324        ValidityStatus validityStatus);
325
326    /**
327     * <p>
328     * Does the same thing as {@link #create(String, String, Timestamp)} with an
329     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
330     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
331     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
332     * transform the entity (into a value object for example). By default, transformation does
333     * not occur.
334     * </p>
335     * @param transform flag to determine transformation type.
336     * @param gearClassification
337     * @param label
338     * @param name
339     * @param status
340     * @param updateDate
341     * @param validityStatus
342     * @return Object
343     */
344    public Object create(
345        int transform,
346        GearClassification gearClassification,
347        String label,
348        String name,
349        Status status,
350        Timestamp updateDate,
351        ValidityStatus validityStatus);
352
353    /**
354     * Updates the <code>gear</code> instance in the persistent store.
355     * @param gear
356     */
357    public void update(Gear gear);
358
359    /**
360     * Updates all instances in the <code>entities</code> collection in the persistent store.
361     * @param entities
362     */
363    public void update(Collection<Gear> entities);
364
365    /**
366     * Removes the instance of Gear from the persistent store.
367     * @param gear
368     */
369    public void remove(Gear gear);
370
371    /**
372     * Removes the instance of Gear having the given
373     * <code>identifier</code> from the persistent store.
374     * @param id
375     */
376    public void remove(Integer id);
377
378    /**
379     * Removes all entities in the given <code>entities</code> collection.
380     * @param entities
381     */
382    public void remove(Collection<Gear> entities);
383
384
385    /**
386     * Does the same thing as {@link #search(int, Search)} but with an
387     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
388     * limit your data to a specified page number and size.
389     *
390     * @param transform the transformation flag.
391     * @param pageNumber the page number in the data to retrieve
392     * @param pageSize the size of the page to retrieve.
393     * @param search the search object which provides the search parameters and pagination specification.
394     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
395     */
396    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
397
398    /**
399     * Does the same thing as {@link #search(Search)} but with an
400     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
401     * limit your data to a specified page number and size.
402     *
403     * @param pageNumber the page number in the data to retrieve
404     * @param pageSize the size of the page to retrieve.
405     * @param search the search object which provides the search parameters and pagination specification.
406     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
407     */
408    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
409
410    /**
411     * Does the same thing as {@link #search(Search)} but with an
412     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
413     * finder results will <strong>NOT</strong> be transformed during retrieval.
414     * If this flag is any of the other constants defined here
415     * then results <strong>WILL BE</strong> passed through an operation which can optionally
416     * transform the entities (into value objects for example). By default, transformation does
417     * not occur.
418     *
419     * @param transform the transformation flag.
420     * @param search the search object which provides the search parameters and pagination specification.
421     * @return any found results from the search.
422     */
423    public Set<?> search(final int transform, final Search search);
424
425    /**
426     * Performs a search using the parameters specified in the given <code>search</code> object.
427     *
428     * @param search the search object which provides the search parameters and pagination specification.
429     * @return any found results from the search.
430     */
431    public Set<Gear> search(final Search search);
432
433    /**
434     * Allows transformation of entities into value objects
435     * (or something else for that matter), when the <code>transform</code>
436     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.gear.GearDao</code>, please note
437     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
438     * will be returned.
439     *
440     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
441     *
442     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.gear.GearDao}
443     * @param entity an entity that was found
444     * @return the transformed entity (i.e. new value object, etc)
445     * @see #transformEntities(int,Collection)
446     */
447    public Object transformEntity(final int transform, final Gear entity);
448
449    /**
450     * Transforms a collection of entities using the
451     * {@link #transformEntity(int,Gear)}
452     * method. This method does not instantiate a new collection.
453     * <p>
454     * This method is to be used internally only.
455     *
456     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.gear.GearDao</code>
457     * @param entities the collection of entities to transform
458     * @see #transformEntity(int,Gear)
459     */
460    public void transformEntities(final int transform, final Collection<?> entities);
461
462    // spring-dao merge-point
463}