001package fr.ifremer.adagio.core.dao.referential.taxon;
002
003/*
004 * #%L
005 * SIH-Adagio :: Core
006 * $Id: TaxonNameExtendDao.java 12089 2014-05-20 19:37:05Z bl05b3e $
007 * $HeadURL: https://forge.ifremer.fr/svn/sih-adagio/tags/adagio-3.5.6/core/src/main/java/fr/ifremer/adagio/core/dao/referential/taxon/TaxonNameExtendDao.java $
008 * %%
009 * Copyright (C) 2012 - 2013 Ifremer
010 * %%
011 * This program is free software: you can redistribute it and/or modify
012 * it under the terms of the GNU Affero General Public License as published by
013 * the Free Software Foundation, either version 3 of the License, or
014 * (at your option) any later version.
015 * 
016 * This program is distributed in the hope that it will be useful,
017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
019 * GNU General Public License for more details.
020 * 
021 * You should have received a copy of the GNU Affero General Public License
022 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
023 * #L%
024 */
025
026public interface TaxonNameExtendDao extends TaxonNameDao {
027
028    /**
029     * Get all taxon names, but obsolete taxon names are skipped.
030     * 
031     * @param withSynonyms
032     *            if {@code true}, return all taxon names, otherwise
033     *            only reference taxon name are returned.
034     * @return
035     */
036    TaxonRefVO[] getAllTaxonNames(boolean withSynonyms);
037
038    TaxonRefVO[] getAllTaxonNames(boolean withSynonyms, Integer transcribingId);
039
040    /**
041     * Get a taxon name by his referenceTaxonId.
042     * Only the reference taxon name is return, but it could be obsolete or temporary.
043     * 
044     * @param referenceTaxonId
045     *            the reference taxon Id
046     * @return the refrence taxon name
047     */
048    TaxonRefVO getTaxonNameReferent(Integer referenceTaxonId);
049
050    /**
051     * Get a taxon name by his referenceTaxonId.
052     * Only the reference taxon name is return, but it could be obsolete or temporary.
053     * 
054     * @param referenceTaxonId
055     *            the reference taxon Id
056     * @return the refrence taxon name
057     */
058    TaxonRefVO getTaxonNameReferent(Integer referenceTaxonId, Integer transcribingId);
059
060    /**
061     * Create a new taxon name, as temporary (used for HSQLDB database only).
062     * 
063     * @param taxonNameVO
064     *            the taxon to Id
065     * @param comments
066     *            an optional comments to store in the taxon name
067     * @return the updated taxon name (with referenceTaxonId and taxonNameId)
068     */
069    TaxonRefVO createAsTemporary(TaxonRefVO taxonNameVO, String comments);
070}