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 java.sql.Timestamp;
033import java.util.Collection;
034import java.util.Date;
035import java.util.Set;
036import org.andromda.spring.PaginationResult;
037
038/**
039 * Classe regroupant les taxons. Il s'agit en fait d'une combinaison entre un rang taxinomique, un
040 * nom de taxon, un code et éventuellement un auteur et une date.
041 * Cette classe regroupe les taxons valides, provisoires, obsolètes, virtuels et les synonymes.
042 * On garde l'historique du passage en taxon valide, puis du passage en synonyme (date de fin
043 * référent).
044 * Dans COST : "Use the FAO reference list ftp://ftp.fao.org/FI/stat/data/ASFIS_sp.zip"
045 * @see TaxonName
046 */
047public interface TaxonNameDao
048{
049    /**
050     * This constant is used as a transformation flag; entities can be converted automatically into value objects
051     * or other types, different methods in a class implementing this interface support this feature: look for
052     * an <code>int</code> parameter called <code>transform</code>.
053     * <p>
054     * This specific flag denotes no transformation will occur.
055     */
056    public static final int TRANSFORM_NONE = 0;
057
058
059    /**
060     * Transforms the given results to a collection of {@link TaxonName}
061     * instances (this is useful when the returned results contains a row of data and you want just entities only).
062     *
063     * @param results the query results.
064     */
065    public void toEntities(final Collection<?> results);
066
067    /**
068     * Gets an instance of TaxonName from the persistent store.
069     * @param id
070     * @return TaxonName
071     */
072    public TaxonName get(Integer id);
073
074    /**
075     * <p>
076     * Does the same thing as {@link #get(Integer)} with an
077     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
078     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
079     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
080     * optionally transform the entity (into a value object for example). By default, transformation does
081     * not occur.
082     * </p>
083     *
084     * @param transform flag to determine transformation type.
085     * @param id the identifier of the entity to get.
086     * @return either the entity or the object transformed from the entity.
087     */
088    public Object get(int transform, Integer id);
089
090    /**
091     * Loads an instance of TaxonName from the persistent store.
092     * @param id
093     * @return TaxonName
094     */
095    public TaxonName load(Integer id);
096
097    /**
098     * <p>
099     * Does the same thing as {@link #load(Integer)} with an
100     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
101     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
102     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
103     * optionally transform the entity (into a value object for example). By default, transformation does
104     * not occur.
105     * </p>
106     *
107     * @param transform flag to determine transformation type.
108     * @param id the identifier of the entity to load.
109     * @return either the entity or the object transformed from the entity.
110     */
111    public Object load(int transform, Integer id);
112
113    /**
114     * Loads all entities of type {@link TaxonName}.
115     *
116     * @return the loaded entities.
117     */
118    public Collection<TaxonName> loadAll();
119
120    /**
121     * <p>
122     * Does the same thing as {@link #loadAll()} with an
123     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
124     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
125     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
126     * transform the entity (into a value object for example). By default, transformation does
127     * not occur.
128     * </p>
129     *
130     * @param transform the flag indicating what transformation to use.
131     * @return the loaded entities.
132     */
133    public Collection<?> loadAll(final int transform);
134
135    /**
136     * <p>
137     * Does the same thing as {@link #loadAll()} with an
138     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
139     * 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
140     * page retrieved.
141     * </p>
142     *
143     * @param pageNumber the page number to retrieve when paging results.
144     * @param pageSize the size of the page to retrieve when paging results.
145     * @return the loaded entities.
146     */
147    public Collection<?> loadAll(final int pageNumber, final int pageSize);
148
149    /**
150     * <p>
151     * Does the same thing as {@link #loadAll(int)} 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 transform the flag indicating what transformation to use.
158     * @param pageNumber the page number to retrieve when paging results.
159     * @param pageSize the size of the page to retrieve when paging results.
160     * @return the loaded entities.
161     */
162    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
163
164    /**
165     * Creates an instance of TaxonName and adds it to the persistent store.
166     * @param taxonName
167     * @return TaxonName
168     */
169    public TaxonName create(TaxonName taxonName);
170
171    /**
172     * <p>
173     * Does the same thing as {@link #create(TaxonName)} with an
174     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
175     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
176     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
177     * transform the entity (into a value object for example). By default, transformation does
178     * not occur.
179     * </p>
180     * @param transform
181     * @param taxonName
182     * @return Object
183     */
184    public Object create(int transform, TaxonName taxonName);
185
186    /**
187     * Creates a new instance of TaxonName and adds
188     * from the passed in <code>entities</code> collection
189     *
190     * @param entities the collection of TaxonName
191     * instances to create.
192     *
193     * @return the created instances.
194     */
195    public Collection<TaxonName> create(Collection<TaxonName> entities);
196
197    /**
198     * <p>
199     * Does the same thing as {@link #create(TaxonName)} with an
200     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
201     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
202     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
203     * transform the entities (into value objects for example). By default, transformation does
204     * not occur.
205     * </p>
206     * @param transform
207     * @param entities
208     * @return Collection
209     */
210    public Collection<?> create(int transform, Collection<TaxonName> entities);
211
212    /**
213     * <p>
214     * Creates a new <code>TaxonName</code>
215     * instance from <strong>all</strong> attributes and adds it to
216     * the persistent store.
217     * </p>
218     * @param name Nom latin présent dans la nomenclature du libellé. Il obéit aux règles de la concaténation du
219libellé décrites dans le règle [R0018].
220     * @param completeName 
221     * @param isNaming Indique si les regles de nomenclature sont à appliquer.
222     * @param isReferent 
223     * @param upperRank Ce numéro d'ordre du taxon dans l'arbre phylogénique permet de classer les fils d'un même taxon père
224et donc l'ensemble des taxons valides les uns par rapport aux autres. Il permet notamment de gérer
225les ordre d'affichage suivant l'ordre taxinomique.
226     * @param isVirtual 
227     * @param isObsolete Indique qu’un taxon est obsolète
228     * @param isTemporary Un libellé peut être provisoire (sp1,sp2 etc.)
229     * @param startDate Date à laquelle le taxon est devenu valide. Cette date peut être vide si le libellé n'a jamais été
230valide. Cette date est renseignée automatiquement par le système.
231     * @param endDate Date où le libellé n'est plus référent et a été remplacé par un autre libellé. Cette date est
232renseignée automatiquement par le système.
233     * @param comments Commentaire associé au libellé du taxon.
234     * @param creationDate Date de création système du libellé. Renseigné automatiquement par le système.
235     * @param updateDate Date de mise à jour système du libellé. Renseigné automatiquement par le système.
236     * @return TaxonName
237     */
238    public TaxonName create(
239        String name,
240        String completeName,
241        Boolean isNaming,
242        Boolean isReferent,
243        Integer upperRank,
244        Boolean isVirtual,
245        Boolean isObsolete,
246        Boolean isTemporary,
247        Date startDate,
248        Date endDate,
249        String comments,
250        Date creationDate,
251        Timestamp updateDate);
252
253    /**
254     * <p>
255     * Does the same thing as {@link #create(String, String, Boolean, Boolean, Integer, Boolean, Boolean, Boolean, Date, Date, String, Date, 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 name Nom latin présent dans la nomenclature du libellé. Il obéit aux règles de la concaténation du
264libellé décrites dans le règle [R0018].
265     * @param completeName 
266     * @param isNaming Indique si les regles de nomenclature sont à appliquer.
267     * @param isReferent 
268     * @param upperRank Ce numéro d'ordre du taxon dans l'arbre phylogénique permet de classer les fils d'un même taxon père
269et donc l'ensemble des taxons valides les uns par rapport aux autres. Il permet notamment de gérer
270les ordre d'affichage suivant l'ordre taxinomique.
271     * @param isVirtual 
272     * @param isObsolete Indique qu’un taxon est obsolète
273     * @param isTemporary Un libellé peut être provisoire (sp1,sp2 etc.)
274     * @param startDate Date à laquelle le taxon est devenu valide. Cette date peut être vide si le libellé n'a jamais été
275valide. Cette date est renseignée automatiquement par le système.
276     * @param endDate Date où le libellé n'est plus référent et a été remplacé par un autre libellé. Cette date est
277renseignée automatiquement par le système.
278     * @param comments Commentaire associé au libellé du taxon.
279     * @param creationDate Date de création système du libellé. Renseigné automatiquement par le système.
280     * @param updateDate Date de mise à jour système du libellé. Renseigné automatiquement par le système.
281     * @return TaxonName
282     */
283    public Object create(
284        int transform,
285        String name,
286        String completeName,
287        Boolean isNaming,
288        Boolean isReferent,
289        Integer upperRank,
290        Boolean isVirtual,
291        Boolean isObsolete,
292        Boolean isTemporary,
293        Date startDate,
294        Date endDate,
295        String comments,
296        Date creationDate,
297        Timestamp updateDate);
298
299    /**
300     * <p>
301     * Creates a new <code>TaxonName</code>
302     * instance from only <strong>required</strong> properties (attributes
303     * and association ends) and adds it to the persistent store.
304     * </p>
305     * @param creationDate
306     * @param isNaming
307     * @param isObsolete
308     * @param isReferent
309     * @param isTemporary
310     * @param isVirtual
311     * @param name
312     * @param referenceTaxon
313     * @param startDate
314     * @param taxonomicLevel
315     * @param updateDate
316     * @param upperRank
317     * @return TaxonName
318     */
319    public TaxonName create(
320        Date creationDate,
321        Boolean isNaming,
322        Boolean isObsolete,
323        Boolean isReferent,
324        Boolean isTemporary,
325        Boolean isVirtual,
326        String name,
327        ReferenceTaxon referenceTaxon,
328        Date startDate,
329        TaxonomicLevel taxonomicLevel,
330        Timestamp updateDate,
331        Integer upperRank);
332
333    /**
334     * <p>
335     * Does the same thing as {@link #create(String, Boolean, Boolean, Integer, Boolean, Boolean, Boolean, Date, Date, Timestamp)} with an
336     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
337     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
338     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
339     * transform the entity (into a value object for example). By default, transformation does
340     * not occur.
341     * </p>
342     * @param transform flag to determine transformation type.
343     * @param creationDate
344     * @param isNaming
345     * @param isObsolete
346     * @param isReferent
347     * @param isTemporary
348     * @param isVirtual
349     * @param name
350     * @param referenceTaxon
351     * @param startDate
352     * @param taxonomicLevel
353     * @param updateDate
354     * @param upperRank
355     * @return Object
356     */
357    public Object create(
358        int transform,
359        Date creationDate,
360        Boolean isNaming,
361        Boolean isObsolete,
362        Boolean isReferent,
363        Boolean isTemporary,
364        Boolean isVirtual,
365        String name,
366        ReferenceTaxon referenceTaxon,
367        Date startDate,
368        TaxonomicLevel taxonomicLevel,
369        Timestamp updateDate,
370        Integer upperRank);
371
372    /**
373     * Updates the <code>taxonName</code> instance in the persistent store.
374     * @param taxonName
375     */
376    public void update(TaxonName taxonName);
377
378    /**
379     * Updates all instances in the <code>entities</code> collection in the persistent store.
380     * @param entities
381     */
382    public void update(Collection<TaxonName> entities);
383
384    /**
385     * Removes the instance of TaxonName from the persistent store.
386     * @param taxonName
387     */
388    public void remove(TaxonName taxonName);
389
390    /**
391     * Removes the instance of TaxonName having the given
392     * <code>identifier</code> from the persistent store.
393     * @param id
394     */
395    public void remove(Integer id);
396
397    /**
398     * Removes all entities in the given <code>entities</code> collection.
399     * @param entities
400     */
401    public void remove(Collection<TaxonName> entities);
402
403
404    /**
405     * Does the same thing as {@link #search(int, Search)} but with an
406     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
407     * limit your data to a specified page number and size.
408     *
409     * @param transform the transformation flag.
410     * @param pageNumber the page number in the data to retrieve
411     * @param pageSize the size of the page to retrieve.
412     * @param search the search object which provides the search parameters and pagination specification.
413     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
414     */
415    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
416
417    /**
418     * Does the same thing as {@link #search(Search)} but with an
419     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
420     * limit your data to a specified page number and size.
421     *
422     * @param pageNumber the page number in the data to retrieve
423     * @param pageSize the size of the page to retrieve.
424     * @param search the search object which provides the search parameters and pagination specification.
425     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
426     */
427    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
428
429    /**
430     * Does the same thing as {@link #search(Search)} but with an
431     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
432     * finder results will <strong>NOT</strong> be transformed during retrieval.
433     * If this flag is any of the other constants defined here
434     * then results <strong>WILL BE</strong> passed through an operation which can optionally
435     * transform the entities (into value objects for example). By default, transformation does
436     * not occur.
437     *
438     * @param transform the transformation flag.
439     * @param search the search object which provides the search parameters and pagination specification.
440     * @return any found results from the search.
441     */
442    public Set<?> search(final int transform, final Search search);
443
444    /**
445     * Performs a search using the parameters specified in the given <code>search</code> object.
446     *
447     * @param search the search object which provides the search parameters and pagination specification.
448     * @return any found results from the search.
449     */
450    public Set<TaxonName> search(final Search search);
451
452    /**
453     * Allows transformation of entities into value objects
454     * (or something else for that matter), when the <code>transform</code>
455     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.taxon.TaxonNameDao</code>, please note
456     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
457     * will be returned.
458     *
459     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
460     *
461     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.taxon.TaxonNameDao}
462     * @param entity an entity that was found
463     * @return the transformed entity (i.e. new value object, etc)
464     * @see #transformEntities(int,Collection)
465     */
466    public Object transformEntity(final int transform, final TaxonName entity);
467
468    /**
469     * Transforms a collection of entities using the
470     * {@link #transformEntity(int,TaxonName)}
471     * method. This method does not instantiate a new collection.
472     * <p>
473     * This method is to be used internally only.
474     *
475     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.taxon.TaxonNameDao</code>
476     * @param entities the collection of entities to transform
477     * @see #transformEntity(int,TaxonName)
478     */
479    public void transformEntities(final int transform, final Collection<?> entities);
480
481    // spring-dao merge-point
482}