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 java.sql.Timestamp;
034import java.util.Collection;
035import java.util.Date;
036import java.util.Set;
037import org.andromda.spring.PaginationResult;
038
039/**
040 * Liste des rangs taxinomiques possibles.
041 * C’est le nom du rang dans la classification systématique ; les niveaux systématiques sont
042 * désignés par des termes consacrés (ex. : espèce, genre, famille, etc.). Le niveau systématique
043 * d’un taxon peut changer avec l’évolution de la classification ; dans ce cas, son libellé est
044 * susceptible de changer également car les suffixes notamment obéissent à des règles strictes de
045 * nomenclature (règle [R0018]).
046 * Les niveaux systématiques pris en compte dans le référentiel taxinomique Quadrige² sont (par
047 * ordre de rang) (le nom anglais de chaque niveau est indiqué entre parenthèses) :
048 * -    Règne (kingdom)
049 * -    Sous-règne (subkingdom)
050 * -    Division (division) / Embranchement (phylum)
051 * -    Subdivision (subdivision) / Sous-embranchement (subphylum)
052 * -    Super-classe (superclass)
053 * -    Classe (class)
054 * -    Sous-classe (subclass)
055 * -    Infra-classe (infraclass)
056 * -    Super-ordre (superordo)
057 * -    Ordre (ordo)
058 * -    Sous-ordre (subordo)
059 * -    Infra-ordre (infraordo)
060 * -    Section (section)
061 * -    Sous-section (subsection)
062 * -    Super-famille (superfamily)
063 * -    Famille (family)
064 * -    Sous-famille (subfamily)
065 * -    Tribu (tribe)
066 * -    Sous-tribu (subtribe)
067 * -    Genre (genus)
068 * -    Sous-genre (subgenus)
069 * -    Espèce (species)
070 * -    Sous-espèce (subspecies)
071 * -    Variété (variety)
072 * -    Sous-variété (subvariety)
073 * -    Forme (forma)
074 * -    Sous-forme (subforma)
075 * -    Incertae sedis (dummy = taxons inclassables)
076 * @see TaxonomicLevel
077 */
078public interface TaxonomicLevelDao
079{
080    /**
081     * This constant is used as a transformation flag; entities can be converted automatically into value objects
082     * or other types, different methods in a class implementing this interface support this feature: look for
083     * an <code>int</code> parameter called <code>transform</code>.
084     * <p>
085     * This specific flag denotes no transformation will occur.
086     */
087    public static final int TRANSFORM_NONE = 0;
088
089
090    /**
091     * Transforms the given results to a collection of {@link TaxonomicLevel}
092     * instances (this is useful when the returned results contains a row of data and you want just entities only).
093     *
094     * @param results the query results.
095     */
096    public void toEntities(final Collection<?> results);
097
098    /**
099     * Gets an instance of TaxonomicLevel from the persistent store.
100     * @param code
101     * @return TaxonomicLevel
102     */
103    public TaxonomicLevel get(String code);
104
105    /**
106     * <p>
107     * Does the same thing as {@link #get(String)} with an
108     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
109     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
110     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
111     * optionally transform the entity (into a value object for example). By default, transformation does
112     * not occur.
113     * </p>
114     *
115     * @param transform flag to determine transformation type.
116     * @param code the identifier of the entity to get.
117     * @return either the entity or the object transformed from the entity.
118     */
119    public Object get(int transform, String code);
120
121    /**
122     * Loads an instance of TaxonomicLevel from the persistent store.
123     * @param code
124     * @return TaxonomicLevel
125     */
126    public TaxonomicLevel load(String code);
127
128    /**
129     * <p>
130     * Does the same thing as {@link #load(String)} with an
131     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
132     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
133     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
134     * optionally transform the entity (into a value object for example). By default, transformation does
135     * not occur.
136     * </p>
137     *
138     * @param transform flag to determine transformation type.
139     * @param code the identifier of the entity to load.
140     * @return either the entity or the object transformed from the entity.
141     */
142    public Object load(int transform, String code);
143
144    /**
145     * Loads all entities of type {@link TaxonomicLevel}.
146     *
147     * @return the loaded entities.
148     */
149    public Collection<TaxonomicLevel> loadAll();
150
151    /**
152     * <p>
153     * Does the same thing as {@link #loadAll()} with an
154     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
155     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
156     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
157     * transform the entity (into a value object for example). By default, transformation does
158     * not occur.
159     * </p>
160     *
161     * @param transform the flag indicating what transformation to use.
162     * @return the loaded entities.
163     */
164    public Collection<?> loadAll(final int transform);
165
166    /**
167     * <p>
168     * Does the same thing as {@link #loadAll()} with an
169     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
170     * 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
171     * page retrieved.
172     * </p>
173     *
174     * @param pageNumber the page number to retrieve when paging results.
175     * @param pageSize the size of the page to retrieve when paging results.
176     * @return the loaded entities.
177     */
178    public Collection<?> loadAll(final int pageNumber, final int pageSize);
179
180    /**
181     * <p>
182     * Does the same thing as {@link #loadAll(int)} with an
183     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
184     * 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
185     * page retrieved.
186     * </p>
187     *
188     * @param transform the flag indicating what transformation to use.
189     * @param pageNumber the page number to retrieve when paging results.
190     * @param pageSize the size of the page to retrieve when paging results.
191     * @return the loaded entities.
192     */
193    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
194
195    /**
196     * Creates an instance of TaxonomicLevel and adds it to the persistent store.
197     * @param taxonomicLevel
198     * @return TaxonomicLevel
199     */
200    public TaxonomicLevel create(TaxonomicLevel taxonomicLevel);
201
202    /**
203     * <p>
204     * Does the same thing as {@link #create(TaxonomicLevel)} 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 entity (into a value object for example). By default, transformation does
209     * not occur.
210     * </p>
211     * @param transform
212     * @param taxonomicLevel
213     * @return Object
214     */
215    public Object create(int transform, TaxonomicLevel taxonomicLevel);
216
217    /**
218     * Creates a new instance of TaxonomicLevel and adds
219     * from the passed in <code>entities</code> collection
220     *
221     * @param entities the collection of TaxonomicLevel
222     * instances to create.
223     *
224     * @return the created instances.
225     */
226    public Collection<TaxonomicLevel> create(Collection<TaxonomicLevel> entities);
227
228    /**
229     * <p>
230     * Does the same thing as {@link #create(TaxonomicLevel)} with an
231     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
232     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
233     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
234     * transform the entities (into value objects for example). By default, transformation does
235     * not occur.
236     * </p>
237     * @param transform
238     * @param entities
239     * @return Collection
240     */
241    public Collection<?> create(int transform, Collection<TaxonomicLevel> entities);
242
243    /**
244     * <p>
245     * Creates a new <code>TaxonomicLevel</code>
246     * instance from <strong>all</strong> attributes and adds it to
247     * the persistent store.
248     * </p>
249     * @param code Code unique identifiant le rang taxinomique.
250     * @param rank Numéro du rang taxinomique.
251Croissant du règne vers l'espèce
252Ceci permet de limiter le choix des niveaux fils aux numéros supérieurs
253     * @param name Libellé du rang taxinomique
254     * @param label Mnémonique du rang taxinomique
255     * @param comments Commentaire décrivant le rang taxinomique
256     * @param creationDate Date de création système du niveau. Renseigné automatiquement par le système.
257     * @param updateDate Date de mise à jour système du niveau. Renseigné automatiquement par le système.
258     * @return TaxonomicLevel
259     */
260    public TaxonomicLevel create(
261        String code,
262        Integer rank,
263        String name,
264        String label,
265        String comments,
266        Date creationDate,
267        Timestamp updateDate);
268
269    /**
270     * <p>
271     * Does the same thing as {@link #create(Integer, String, String, String, Date, Timestamp)} with an
272     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
273     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
274     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
275     * transform the entity (into a value object for example). By default, transformation does
276     * not occur.
277     * </p>
278     * @param transform
279     * @param code Code unique identifiant le rang taxinomique.
280     * @param rank Numéro du rang taxinomique.
281Croissant du règne vers l'espèce
282Ceci permet de limiter le choix des niveaux fils aux numéros supérieurs
283     * @param name Libellé du rang taxinomique
284     * @param label Mnémonique du rang taxinomique
285     * @param comments Commentaire décrivant le rang taxinomique
286     * @param creationDate Date de création système du niveau. Renseigné automatiquement par le système.
287     * @param updateDate Date de mise à jour système du niveau. Renseigné automatiquement par le système.
288     * @return TaxonomicLevel
289     */
290    public Object create(
291        int transform,
292        String code,
293        Integer rank,
294        String name,
295        String label,
296        String comments,
297        Date creationDate,
298        Timestamp updateDate);
299
300    /**
301     * <p>
302     * Creates a new <code>TaxonomicLevel</code>
303     * instance from only <strong>required</strong> properties (attributes
304     * and association ends) and adds it to the persistent store.
305     * </p>
306     * @param creationDate
307     * @param name
308     * @param rank
309     * @param status
310     * @param updateDate
311     * @return TaxonomicLevel
312     */
313    public TaxonomicLevel create(
314        Date creationDate,
315        String name,
316        Integer rank,
317        Status status,
318        Timestamp updateDate);
319
320    /**
321     * <p>
322     * Does the same thing as {@link #create(Integer, String, Date, Timestamp)} with an
323     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
324     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
325     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
326     * transform the entity (into a value object for example). By default, transformation does
327     * not occur.
328     * </p>
329     * @param transform flag to determine transformation type.
330     * @param creationDate
331     * @param name
332     * @param rank
333     * @param status
334     * @param updateDate
335     * @return Object
336     */
337    public Object create(
338        int transform,
339        Date creationDate,
340        String name,
341        Integer rank,
342        Status status,
343        Timestamp updateDate);
344
345    /**
346     * Updates the <code>taxonomicLevel</code> instance in the persistent store.
347     * @param taxonomicLevel
348     */
349    public void update(TaxonomicLevel taxonomicLevel);
350
351    /**
352     * Updates all instances in the <code>entities</code> collection in the persistent store.
353     * @param entities
354     */
355    public void update(Collection<TaxonomicLevel> entities);
356
357    /**
358     * Removes the instance of TaxonomicLevel from the persistent store.
359     * @param taxonomicLevel
360     */
361    public void remove(TaxonomicLevel taxonomicLevel);
362
363    /**
364     * Removes the instance of TaxonomicLevel having the given
365     * <code>identifier</code> from the persistent store.
366     * @param code
367     */
368    public void remove(String code);
369
370    /**
371     * Removes all entities in the given <code>entities</code> collection.
372     * @param entities
373     */
374    public void remove(Collection<TaxonomicLevel> entities);
375
376
377    /**
378     * Does the same thing as {@link #search(int, Search)} but with an
379     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
380     * limit your data to a specified page number and size.
381     *
382     * @param transform the transformation flag.
383     * @param pageNumber the page number in the data to retrieve
384     * @param pageSize the size of the page to retrieve.
385     * @param search the search object which provides the search parameters and pagination specification.
386     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
387     */
388    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
389
390    /**
391     * Does the same thing as {@link #search(Search)} but with an
392     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
393     * limit your data to a specified page number and size.
394     *
395     * @param pageNumber the page number in the data to retrieve
396     * @param pageSize the size of the page to retrieve.
397     * @param search the search object which provides the search parameters and pagination specification.
398     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
399     */
400    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
401
402    /**
403     * Does the same thing as {@link #search(Search)} but with an
404     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
405     * finder results will <strong>NOT</strong> be transformed during retrieval.
406     * If this flag is any of the other constants defined here
407     * then results <strong>WILL BE</strong> passed through an operation which can optionally
408     * transform the entities (into value objects for example). By default, transformation does
409     * not occur.
410     *
411     * @param transform the transformation flag.
412     * @param search the search object which provides the search parameters and pagination specification.
413     * @return any found results from the search.
414     */
415    public Set<?> search(final int transform, final Search search);
416
417    /**
418     * Performs a search using the parameters specified in the given <code>search</code> object.
419     *
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<TaxonomicLevel> search(final Search search);
424
425    /**
426     * Allows transformation of entities into value objects
427     * (or something else for that matter), when the <code>transform</code>
428     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.taxon.TaxonomicLevelDao</code>, please note
429     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
430     * will be returned.
431     *
432     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
433     *
434     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.taxon.TaxonomicLevelDao}
435     * @param entity an entity that was found
436     * @return the transformed entity (i.e. new value object, etc)
437     * @see #transformEntities(int,Collection)
438     */
439    public Object transformEntity(final int transform, final TaxonomicLevel entity);
440
441    /**
442     * Transforms a collection of entities using the
443     * {@link #transformEntity(int,TaxonomicLevel)}
444     * method. This method does not instantiate a new collection.
445     * <p>
446     * This method is to be used internally only.
447     *
448     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.taxon.TaxonomicLevelDao</code>
449     * @param entities the collection of entities to transform
450     * @see #transformEntity(int,TaxonomicLevel)
451     */
452    public void transformEntities(final int transform, final Collection<?> entities);
453
454    // spring-dao merge-point
455}