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.taxon;
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.Date;
037import java.util.Set;
038import org.andromda.spring.PaginationResult;
039
040/**
041 * Il désigne un ensemble de taxons appartenant à des groupes taxinomiques différents mais ayant les
042 * mêmes caractéristiques pour un critère donné. Ce critère peut être morpho-anatomique (par exemple
043 * les strates algales ou la taille des organismes), comportemental (par exemple des groupes
044 * trophiques ou des modes de déplacement), ou encore basé sur des notions plus complexes comme la
045 * polluo-sensibilité (exemple des groupes écologiques définis pour les macroinvertébrés
046 * benthiques). Pour un critère donné, les groupes de taxons sont rassemblés dans un regroupement
047 * appelé groupe de taxons père.
048 * Les groupes de taxons sont de deux catégories :
049 * - Descriptif : c'est à dire seulement utilisé pour l'extraction de données. Les regroupements de
050 * taxons sont effectués en aval de la mesure effectuée.
051 * - Identification : il s'agit de regroupements utilisés pour identifier des catégories de taxons
052 * sur le terrain ou en laboratoire, lorsqu'il est difficile d'opérer une identification précise ou
053 * lorsque celle-ci s'avère tout simplement impossible ou non pertinente. Le regroupement des taxons
054 * s'effectue alors en amont de la mesure.
055 * Certains groupes peuvent être figés, c'est à dire qu'ils sont définis une bonne fois pour toute
056 * dans un document. Pour ce dernier cas particulier, il n'y a donc, a priori, pas besoin de mise à
057 * jour, et encore moins de pouvoir les supprimer : ils sont donc non modifiables (mais ce ne doit
058 * pas être une règle générale)
059 * @see TaxonGroup
060 */
061public interface TaxonGroupDao
062{
063    /**
064     * This constant is used as a transformation flag; entities can be converted automatically into value objects
065     * or other types, different methods in a class implementing this interface support this feature: look for
066     * an <code>int</code> parameter called <code>transform</code>.
067     * <p>
068     * This specific flag denotes no transformation will occur.
069     */
070    public static final int TRANSFORM_NONE = 0;
071
072
073    /**
074     * Transforms the given results to a collection of {@link TaxonGroup}
075     * instances (this is useful when the returned results contains a row of data and you want just entities only).
076     *
077     * @param results the query results.
078     */
079    public void toEntities(final Collection<?> results);
080
081    /**
082     * Gets an instance of TaxonGroup from the persistent store.
083     * @param id
084     * @return TaxonGroup
085     */
086    public TaxonGroup get(Integer id);
087
088    /**
089     * <p>
090     * Does the same thing as {@link #get(Integer)} with an
091     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
092     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
093     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
094     * optionally transform the entity (into a value object for example). By default, transformation does
095     * not occur.
096     * </p>
097     *
098     * @param transform flag to determine transformation type.
099     * @param id the identifier of the entity to get.
100     * @return either the entity or the object transformed from the entity.
101     */
102    public Object get(int transform, Integer id);
103
104    /**
105     * Loads an instance of TaxonGroup from the persistent store.
106     * @param id
107     * @return TaxonGroup
108     */
109    public TaxonGroup load(Integer id);
110
111    /**
112     * <p>
113     * Does the same thing as {@link #load(Integer)} with an
114     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
115     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
116     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
117     * optionally transform the entity (into a value object for example). By default, transformation does
118     * not occur.
119     * </p>
120     *
121     * @param transform flag to determine transformation type.
122     * @param id the identifier of the entity to load.
123     * @return either the entity or the object transformed from the entity.
124     */
125    public Object load(int transform, Integer id);
126
127    /**
128     * Loads all entities of type {@link TaxonGroup}.
129     *
130     * @return the loaded entities.
131     */
132    public Collection<TaxonGroup> loadAll();
133
134    /**
135     * <p>
136     * Does the same thing as {@link #loadAll()} with an
137     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
138     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
139     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
140     * transform the entity (into a value object for example). By default, transformation does
141     * not occur.
142     * </p>
143     *
144     * @param transform the flag indicating what transformation to use.
145     * @return the loaded entities.
146     */
147    public Collection<?> loadAll(final int transform);
148
149    /**
150     * <p>
151     * Does the same thing as {@link #loadAll()} with an
152     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
153     * 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
154     * page retrieved.
155     * </p>
156     *
157     * @param pageNumber the page number to retrieve when paging results.
158     * @param pageSize the size of the page to retrieve when paging results.
159     * @return the loaded entities.
160     */
161    public Collection<?> loadAll(final int pageNumber, final int pageSize);
162
163    /**
164     * <p>
165     * Does the same thing as {@link #loadAll(int)} with an
166     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
167     * 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
168     * page retrieved.
169     * </p>
170     *
171     * @param transform the flag indicating what transformation to use.
172     * @param pageNumber the page number to retrieve when paging results.
173     * @param pageSize the size of the page to retrieve when paging results.
174     * @return the loaded entities.
175     */
176    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
177
178    /**
179     * Creates an instance of TaxonGroup and adds it to the persistent store.
180     * @param taxonGroup
181     * @return TaxonGroup
182     */
183    public TaxonGroup create(TaxonGroup taxonGroup);
184
185    /**
186     * <p>
187     * Does the same thing as {@link #create(TaxonGroup)} with an
188     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
189     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
190     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
191     * transform the entity (into a value object for example). By default, transformation does
192     * not occur.
193     * </p>
194     * @param transform
195     * @param taxonGroup
196     * @return Object
197     */
198    public Object create(int transform, TaxonGroup taxonGroup);
199
200    /**
201     * Creates a new instance of TaxonGroup and adds
202     * from the passed in <code>entities</code> collection
203     *
204     * @param entities the collection of TaxonGroup
205     * instances to create.
206     *
207     * @return the created instances.
208     */
209    public Collection<TaxonGroup> create(Collection<TaxonGroup> entities);
210
211    /**
212     * <p>
213     * Does the same thing as {@link #create(TaxonGroup)} with an
214     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
215     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
216     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
217     * transform the entities (into value objects for example). By default, transformation does
218     * not occur.
219     * </p>
220     * @param transform
221     * @param entities
222     * @return Collection
223     */
224    public Collection<?> create(int transform, Collection<TaxonGroup> entities);
225
226    /**
227     * <p>
228     * Creates a new <code>TaxonGroup</code>
229     * instance from <strong>all</strong> attributes and adds it to
230     * the persistent store.
231     * </p>
232     * @param label Code (ou mnénomique) du groupe de taxons. Ceci peut être un code de quelques caractères identifiant
233le groupe. (exemple: Ca pour carnivores)
234     * @param name Nom du groupe de taxons.
235     * @param comments Commentaire long associé au groupe de taxons.
236     * @param isChildGroupExclusive Ce champ permet de renseigner si les groupes de taxons fils sont exclusifs ou pas. Par défaut, les
237fils ne sont pas exclusifs. S'ils sont exclusifs, un même taxon ne pourra pas faire parti de
238plusieurs groupes du même taxon père.
239     * @param isUpdatable Cette information permet de savoir si un groupe de taxons est modifiable ou pas dans l'interface de
240mise à jour.
241     * @param creationDate Date de création système du groupe. Renseigné automatiquement par le système.
242     * @param updateDate Date de mise à jour système du groupe. Renseigné automatiquement par le système.
243     * @return TaxonGroup
244     */
245    public TaxonGroup create(
246        String label,
247        String name,
248        String comments,
249        Boolean isChildGroupExclusive,
250        Boolean isUpdatable,
251        Date creationDate,
252        Timestamp updateDate);
253
254    /**
255     * <p>
256     * Does the same thing as {@link #create(String, String, String, Boolean, Boolean, Date, Timestamp)} with an
257     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
258     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
259     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
260     * transform the entity (into a value object for example). By default, transformation does
261     * not occur.
262     * </p>
263     * @param transform
264     * @param label Code (ou mnénomique) du groupe de taxons. Ceci peut être un code de quelques caractères identifiant
265le groupe. (exemple: Ca pour carnivores)
266     * @param name Nom du groupe de taxons.
267     * @param comments Commentaire long associé au groupe de taxons.
268     * @param isChildGroupExclusive Ce champ permet de renseigner si les groupes de taxons fils sont exclusifs ou pas. Par défaut, les
269fils ne sont pas exclusifs. S'ils sont exclusifs, un même taxon ne pourra pas faire parti de
270plusieurs groupes du même taxon père.
271     * @param isUpdatable Cette information permet de savoir si un groupe de taxons est modifiable ou pas dans l'interface de
272mise à jour.
273     * @param creationDate Date de création système du groupe. Renseigné automatiquement par le système.
274     * @param updateDate Date de mise à jour système du groupe. Renseigné automatiquement par le système.
275     * @return TaxonGroup
276     */
277    public Object create(
278        int transform,
279        String label,
280        String name,
281        String comments,
282        Boolean isChildGroupExclusive,
283        Boolean isUpdatable,
284        Date creationDate,
285        Timestamp updateDate);
286
287    /**
288     * <p>
289     * Creates a new <code>TaxonGroup</code>
290     * instance from only <strong>required</strong> properties (attributes
291     * and association ends) and adds it to the persistent store.
292     * </p>
293     * @param creationDate
294     * @param isChildGroupExclusive
295     * @param isUpdatable
296     * @param name
297     * @param status
298     * @param taxonGroupType
299     * @param updateDate
300     * @param validityStatus
301     * @return TaxonGroup
302     */
303    public TaxonGroup create(
304        Date creationDate,
305        Boolean isChildGroupExclusive,
306        Boolean isUpdatable,
307        String name,
308        Status status,
309        TaxonGroupType taxonGroupType,
310        Timestamp updateDate,
311        ValidityStatus validityStatus);
312
313    /**
314     * <p>
315     * Does the same thing as {@link #create(String, Boolean, Boolean, Date, Timestamp)} with an
316     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
317     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
318     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
319     * transform the entity (into a value object for example). By default, transformation does
320     * not occur.
321     * </p>
322     * @param transform flag to determine transformation type.
323     * @param creationDate
324     * @param isChildGroupExclusive
325     * @param isUpdatable
326     * @param name
327     * @param status
328     * @param taxonGroupType
329     * @param updateDate
330     * @param validityStatus
331     * @return Object
332     */
333    public Object create(
334        int transform,
335        Date creationDate,
336        Boolean isChildGroupExclusive,
337        Boolean isUpdatable,
338        String name,
339        Status status,
340        TaxonGroupType taxonGroupType,
341        Timestamp updateDate,
342        ValidityStatus validityStatus);
343
344    /**
345     * Updates the <code>taxonGroup</code> instance in the persistent store.
346     * @param taxonGroup
347     */
348    public void update(TaxonGroup taxonGroup);
349
350    /**
351     * Updates all instances in the <code>entities</code> collection in the persistent store.
352     * @param entities
353     */
354    public void update(Collection<TaxonGroup> entities);
355
356    /**
357     * Removes the instance of TaxonGroup from the persistent store.
358     * @param taxonGroup
359     */
360    public void remove(TaxonGroup taxonGroup);
361
362    /**
363     * Removes the instance of TaxonGroup having the given
364     * <code>identifier</code> from the persistent store.
365     * @param id
366     */
367    public void remove(Integer id);
368
369    /**
370     * Removes all entities in the given <code>entities</code> collection.
371     * @param entities
372     */
373    public void remove(Collection<TaxonGroup> entities);
374
375
376    /**
377     * Does the same thing as {@link #search(int, Search)} but with an
378     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
379     * limit your data to a specified page number and size.
380     *
381     * @param transform the transformation flag.
382     * @param pageNumber the page number in the data to retrieve
383     * @param pageSize the size of the page to retrieve.
384     * @param search the search object which provides the search parameters and pagination specification.
385     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
386     */
387    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
388
389    /**
390     * Does the same thing as {@link #search(Search)} but with an
391     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
392     * limit your data to a specified page number and size.
393     *
394     * @param pageNumber the page number in the data to retrieve
395     * @param pageSize the size of the page to retrieve.
396     * @param search the search object which provides the search parameters and pagination specification.
397     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
398     */
399    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
400
401    /**
402     * Does the same thing as {@link #search(Search)} but with an
403     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
404     * finder results will <strong>NOT</strong> be transformed during retrieval.
405     * If this flag is any of the other constants defined here
406     * then results <strong>WILL BE</strong> passed through an operation which can optionally
407     * transform the entities (into value objects for example). By default, transformation does
408     * not occur.
409     *
410     * @param transform the transformation flag.
411     * @param search the search object which provides the search parameters and pagination specification.
412     * @return any found results from the search.
413     */
414    public Set<?> search(final int transform, final Search search);
415
416    /**
417     * Performs a search using the parameters specified in the given <code>search</code> object.
418     *
419     * @param search the search object which provides the search parameters and pagination specification.
420     * @return any found results from the search.
421     */
422    public Set<TaxonGroup> search(final Search search);
423
424    /**
425     * Allows transformation of entities into value objects
426     * (or something else for that matter), when the <code>transform</code>
427     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.taxon.TaxonGroupDao</code>, please note
428     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
429     * will be returned.
430     *
431     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
432     *
433     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.taxon.TaxonGroupDao}
434     * @param entity an entity that was found
435     * @return the transformed entity (i.e. new value object, etc)
436     * @see #transformEntities(int,Collection)
437     */
438    public Object transformEntity(final int transform, final TaxonGroup entity);
439
440    /**
441     * Transforms a collection of entities using the
442     * {@link #transformEntity(int,TaxonGroup)}
443     * method. This method does not instantiate a new collection.
444     * <p>
445     * This method is to be used internally only.
446     *
447     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.taxon.TaxonGroupDao</code>
448     * @param entities the collection of entities to transform
449     * @see #transformEntity(int,TaxonGroup)
450     */
451    public void transformEntities(final int transform, final Collection<?> entities);
452
453    // spring-dao merge-point
454}