eu.etaxonomy.cdm.persistence.dao.taxon
Interface ITaxonDao

All Superinterfaces:
IAnnotatableDao<TaxonBase>, ICdmEntityDao<TaxonBase>, IIdentifiableDao<TaxonBase>, ISearchableDao<TaxonBase>, ITitledDao<TaxonBase>, IVersionableDao<TaxonBase>
All Known Implementing Classes:
TaxonDaoHibernateImpl

public interface ITaxonDao
extends IIdentifiableDao<TaxonBase>, ITitledDao<TaxonBase>

Author:
a.mueller

Method Summary
 int countAllRelationships()
           
 int countMatchesByName(String queryString, MatchMode matchMode, boolean onlyAcccepted)
           
 int countMatchesByName(String queryString, MatchMode matchMode, boolean onlyAcccepted, List<org.hibernate.criterion.Criterion> criteria)
           
 Integer countSynonymRelationships(TaxonBase taxonBase, SynonymRelationshipType type, RelationshipBase.Direction relatedfrom)
           
 int countSynonyms(Synonym synonym, SynonymRelationshipType type)
          Returns a count of the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied synonym is relatedFrom.
 int countSynonyms(Taxon taxon, SynonymRelationshipType type)
          Returns a count of the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied taxon is relatedTo.
 long countTaxaByCommonName(String searchString, Classification classification, MatchMode matchMode, Set<NamedArea> namedAreas)
           
 long countTaxaByName(boolean doTaxa, boolean doSynonyms, boolean doMisappliedNames, String queryString, Classification classification, MatchMode matchMode, Set<NamedArea> namedAreas)
           
 int countTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank)
          Returns a count of TaxonBase instances where the taxon.name properties match the parameters passed.
 int countTaxonRelationships(Taxon taxon, TaxonRelationshipType type, RelationshipBase.Direction direction)
          Returns a count of the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon either is relatedFrom or relatedTo depending on the direction parameter.
 long deleteSynonymRelationships(Synonym syn, Taxon taxon)
          Deletes all synonym relationships of a given synonym.
 List<TaxonBase> findByNameTitleCache(boolean doTaxa, boolean doSynonyms, String queryString, Classification classification, MatchMode matchMode, Set<NamedArea> namedAreas, Integer pageNumber, Integer pageSize, List<String> propertyPaths)
          Find taxa by searching for Taxa and Synonyms where the TaxonNameBase.titleCache matches the name specified as queryString taxonName
 TaxonBase findByUuid(UUID uuid, List<org.hibernate.criterion.Criterion> criteria, List<String> propertyPaths)
          Returns a taxon corresponding to the given uuid
 List<? extends TaxonBase> findByUuids(List<UUID> uuids, List<org.hibernate.criterion.Criterion> criteria, List<String> propertyPaths)
          Returns a list of Taxon entities corresponding to the given uuid list.
 List<TaxonNameBase> findIdenticalNamesNew(List<String> propertyPaths)
           
 List<UUID> findIdenticalTaxonNameIds(List<String> propertyPath)
           
 List<TaxonNameBase> findIdenticalTaxonNames(List<String> propertyPath)
          Creates all inferred synonyms for the species in the tree and insert it to the database
 List<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber)
          Returns a list of TaxonBase instances where the taxon.name properties match the parameters passed.
 List<RelationshipBase> getAllRelationships(Integer limit, Integer start)
           
 List<Synonym> getAllSynonyms(Integer limit, Integer start)
           
 List<Taxon> getAllTaxa(Integer limit, Integer start)
           
 List<TaxonBase> getAllTaxonBases(Integer pagesize, Integer page)
          TODO necessary?
 String getPhylumName(TaxonNameBase name)
           
 List<Taxon> getRootTaxa(Rank rank, Reference sec, CdmFetch cdmFetch, Boolean onlyWithChildren, Boolean withMisapplications, List<String> propertyPaths)
          Deprecated. obsolete when using classification
 List<Taxon> getRootTaxa(Reference sec)
          Deprecated. obsolete when using classification
 List<Taxon> getRootTaxa(Reference sec, CdmFetch cdmFetch, Boolean onlyWithChildren, Boolean withMisapplications)
          Deprecated. obsolete when using classification
 List<SynonymRelationship> getSynonymRelationships(TaxonBase taxonBase, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths, RelationshipBase.Direction relatedfrom)
           
 List<SynonymRelationship> getSynonyms(Synonym synoynm, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied synonym is relatedFrom.
 List<SynonymRelationship> getSynonyms(Taxon taxon, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied taxon is relatedTo.
 List<Object[]> getTaxaByCommonName(String queryString, Classification classification, MatchMode matchMode, Set<NamedArea> namedAreas, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
           
 List<TaxonBase> getTaxaByName(boolean doTaxa, boolean doSynonyms, boolean doMisappliedNames, String queryString, Classification classification, MatchMode matchMode, Set<NamedArea> namedAreas, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) where the taxonBase.name.nameCache property matches the String queryString.
 List<TaxonBase> getTaxaByName(String queryString, Boolean accepted, Reference sec)
          Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) where the taxonBase.name.nameCache property matches the String queryString, and taxon.sec matches the sec parameter.
 List<TaxonBase> getTaxaByName(String queryString, MatchMode matchMode, Boolean accepted, Integer pageSize, Integer pageNumber)
          Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) where the taxonBase.name.nameCache property matches the String queryString.
 List<TaxonBase> getTaxaByName(String name, Reference sec)
          Returns a list of TaxonBase instances where the taxon.titleCache property matches the name parameter, and taxon.sec matches the sec parameter.
 List<UuidAndTitleCache<TaxonBase>> getTaxaByNameForEditor(boolean doTaxa, boolean doSynonyms, String queryString, Classification classification, MatchMode matchMode, Set<NamedArea> namedAreas)
           
 List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification)
           
 List<TaxonRelationship> getTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths, RelationshipBase.Direction direction)
          Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon either is relatedFrom or relatedTo depending on the direction parameter.
 List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheSynonym()
           
 List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheTaxon()
           
 List<String> taxaByNameNotInDB(List<String> taxonNames)
           
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao
countByReferenceTitle, countByTitle, countRights, countSources, countTitleCache, find, findByReferenceTitle, findByTitle, findOriginalSourceByIdInSource, findTitleCache, getRights, getSources, getUuidAndTitleCache
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao
countAnnotations, countMarkers, countMarkers, getAnnotations, getMarkers, groupMarkers
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.IVersionableDao
countAuditEvents, countAuditEvents, getAuditEvents, getAuditEvents, getNextAuditEvent, getPreviousAuditEvent
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao
clear, count, count, count, delete, exists, findById, findByUuid, flush, getSession, getType, group, list, list, list, list, list, list, list, listByIds, load, load, load, lock, merge, refresh, refresh, replace, rows, save, saveAll, saveOrUpdate, saveOrUpdateAll, update
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.ITitledDao
countByTitle, countByTitle, countByTitle, findByTitle, findByTitle, findByTitle, findByTitleAndClass
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.ISearchableDao
count, optimizeIndex, purgeIndex, rebuildIndex, search, suggestQuery
 

Method Detail

getTaxaByName

List<TaxonBase> getTaxaByName(String name,
                              Reference sec)
Returns a list of TaxonBase instances where the taxon.titleCache property matches the name parameter, and taxon.sec matches the sec parameter.

Parameters:
name -
sec -
Returns:

getTaxaByName

List<TaxonBase> getTaxaByName(String queryString,
                              Boolean accepted,
                              Reference sec)
Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) where the taxonBase.name.nameCache property matches the String queryString, and taxon.sec matches the sec parameter.

Parameters:
name -
sec -
Returns:

getTaxaByName

List<TaxonBase> getTaxaByName(String queryString,
                              MatchMode matchMode,
                              Boolean accepted,
                              Integer pageSize,
                              Integer pageNumber)
Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) where the taxonBase.name.nameCache property matches the String queryString.

Parameters:
queryString -
matchMode -
accepted -
pageSize -
pageNumber -
Returns:

getTaxaByName

List<TaxonBase> getTaxaByName(boolean doTaxa,
                              boolean doSynonyms,
                              boolean doMisappliedNames,
                              String queryString,
                              Classification classification,
                              MatchMode matchMode,
                              Set<NamedArea> namedAreas,
                              Integer pageSize,
                              Integer pageNumber,
                              List<String> propertyPaths)
Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) where the taxonBase.name.nameCache property matches the String queryString.

Parameters:
doTaxa -
doSynonyms -
queryString -
classification - TODO
matchMode -
namedAreas - TODO
pageSize -
pageNumber -
propertyPaths - TODO
Returns:
list of found taxa

countTaxaByName

long countTaxaByName(boolean doTaxa,
                     boolean doSynonyms,
                     boolean doMisappliedNames,
                     String queryString,
                     Classification classification,
                     MatchMode matchMode,
                     Set<NamedArea> namedAreas)
Parameters:
doTaxa -
doSynonyms -
queryString -
classification - TODO
matchMode -
namedAreas -
pageSize -
pageNumber -
propertyPaths -
Returns:

countTaxaByName

int countTaxaByName(Class<? extends TaxonBase> clazz,
                    String uninomial,
                    String infragenericEpithet,
                    String specificEpithet,
                    String infraspecificEpithet,
                    Rank rank)
Returns a count of TaxonBase instances where the taxon.name properties match the parameters passed.

Parameters:
doTaxa -
doSynonyms -
uninomial -
infragenericEpithet -
specificEpithet -
infraspecificEpithet -
rank -
Returns:
a count of TaxonBase instances

findTaxaByName

List<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz,
                               String uninomial,
                               String infragenericEpithet,
                               String specificEpithet,
                               String infraspecificEpithet,
                               Rank rank,
                               Integer pageSize,
                               Integer pageNumber)
Returns a list of TaxonBase instances where the taxon.name properties match the parameters passed. In order to search for any string value, pass '*', passing the string value of null will search for those taxa with a value of null in that field

Compare with #findByName(String, MatchMode, int, int, boolean) which searches for TaxonNameBase.titleCache

Parameters:
doTaxa -
doSynonyms -
uninomial -
infragenericEpithet -
specificEpithet -
infraspecificEpithet -
rank -
pageSize - The maximum number of taxa returned (can be null for all matching taxa)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
Returns:
a list of TaxonBase instances

findByNameTitleCache

List<TaxonBase> findByNameTitleCache(boolean doTaxa,
                                     boolean doSynonyms,
                                     String queryString,
                                     Classification classification,
                                     MatchMode matchMode,
                                     Set<NamedArea> namedAreas,
                                     Integer pageNumber,
                                     Integer pageSize,
                                     List<String> propertyPaths)
Find taxa by searching for Taxa and Synonyms where the TaxonNameBase.titleCache matches the name specified as queryString taxonName

Compare with findTaxaByName(Class, String, String, String, String, Rank, Integer, Integer) which searches for TaxonNameBase.nameCache

Parameters:
queryString - the taqxon Name to search for
classification - TODO
matchMode -
namedAreas - TODO
pageNumber -
pageSize -
onlyAcccepted -
Returns:

findByUuid

TaxonBase findByUuid(UUID uuid,
                     List<org.hibernate.criterion.Criterion> criteria,
                     List<String> propertyPaths)
Returns a taxon corresponding to the given uuid

Parameters:
uuid - The uuid of the taxon requested
criteria - Custom criteria to be added to the default list of applied criteria.
propertyPaths -
Returns:

findByUuids

List<? extends TaxonBase> findByUuids(List<UUID> uuids,
                                      List<org.hibernate.criterion.Criterion> criteria,
                                      List<String> propertyPaths)
Returns a list of Taxon entities corresponding to the given uuid list.

Parameters:
uuids -
criteria -
propertyPaths -
Returns:

getTaxaByCommonName

List<Object[]> getTaxaByCommonName(String queryString,
                                   Classification classification,
                                   MatchMode matchMode,
                                   Set<NamedArea> namedAreas,
                                   Integer pageSize,
                                   Integer pageNumber,
                                   List<String> propertyPaths)
Parameters:
queryString -
classification -
matchMode -
namedAreas -
pageSize -
pageNumber -
propertyPaths -
Returns:
A List of arrays. Each entry array holds the following entities: Taxon, CommonName, Description, Feature

getRootTaxa

List<Taxon> getRootTaxa(Reference sec)
Deprecated. obsolete when using classification

Computes all Taxon instances that do not have a taxonomic parent and has at least one child.

Returns:
The List of root taxa.

getRootTaxa

List<Taxon> getRootTaxa(Reference sec,
                        CdmFetch cdmFetch,
                        Boolean onlyWithChildren,
                        Boolean withMisapplications)
Deprecated. obsolete when using classification

Computes all Taxon instances that do not have a taxonomic parent.

Parameters:
sec - The concept reference that the taxon belongs to
cdmFetch - not used yet !! TODO
onlyWithChildren - if true only taxa are returned that have taxonomic children.
Default: true.
withMisaplications - if false only taxa are returned that have no isMisappliedNameFor relationship.
Default: true.
Returns:
The List of root taxa.

getRootTaxa

List<Taxon> getRootTaxa(Rank rank,
                        Reference sec,
                        CdmFetch cdmFetch,
                        Boolean onlyWithChildren,
                        Boolean withMisapplications,
                        List<String> propertyPaths)
Deprecated. obsolete when using classification

Computes all Taxon instances which name is of a certain Rank.

Parameters:
rank - The rank of the taxon name
sec - The concept reference that the taxon belongs to
cdmFetch - not used yet !! TODO
onlyWithChildren - if true only taxa are returned that have taxonomic children.
Default: true.
withMisaplications - if false only taxa are returned that have no isMisappliedNameFor relationship.
propertyPaths - properties to be initialized, For detailed description and examples please refer to: IBeanInitializer.initialize(Object, List).
Default: true.
Returns:
The List of root taxa.

getAllTaxonBases

List<TaxonBase> getAllTaxonBases(Integer pagesize,
                                 Integer page)
TODO necessary?

Parameters:
pagesize - max maximum number of returned taxa
page - page to start, with 0 being first page
Returns:

getAllTaxa

List<Taxon> getAllTaxa(Integer limit,
                       Integer start)
Parameters:
limit -
start -
Returns:

getAllSynonyms

List<Synonym> getAllSynonyms(Integer limit,
                             Integer start)
Parameters:
limit -
start -
Returns:

getAllRelationships

List<RelationshipBase> getAllRelationships(Integer limit,
                                           Integer start)

countAllRelationships

int countAllRelationships()

countMatchesByName

int countMatchesByName(String queryString,
                       MatchMode matchMode,
                       boolean onlyAcccepted)
Parameters:
queryString -
matchMode -
onlyAcccepted -
Returns:

countMatchesByName

int countMatchesByName(String queryString,
                       MatchMode matchMode,
                       boolean onlyAcccepted,
                       List<org.hibernate.criterion.Criterion> criteria)
Parameters:
queryString -
matchMode -
onlyAcccepted -
criteria -
Returns:

countTaxonRelationships

int countTaxonRelationships(Taxon taxon,
                            TaxonRelationshipType type,
                            RelationshipBase.Direction direction)
Returns a count of the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon either is relatedFrom or relatedTo depending on the direction parameter.

Parameters:
taxon - The taxon that is relatedFrom
type - The type of TaxonRelationship (can be null)
direction - specifies the direction of the relationship
Returns:
the number of TaxonRelationship instances

getTaxonRelationships

List<TaxonRelationship> getTaxonRelationships(Taxon taxon,
                                              TaxonRelationshipType type,
                                              Integer pageSize,
                                              Integer pageNumber,
                                              List<OrderHint> orderHints,
                                              List<String> propertyPaths,
                                              RelationshipBase.Direction direction)
Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon either is relatedFrom or relatedTo depending on the direction parameter.

Parameters:
taxon - The taxon that is relatedTo
type - The type of TaxonRelationship (can be null)
pageSize - The maximum number of relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - Properties to order by
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
direction - specifies the direction of the relationship
Returns:
a List of TaxonRelationship instances

countSynonyms

int countSynonyms(Taxon taxon,
                  SynonymRelationshipType type)
Returns a count of the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied taxon is relatedTo.

Parameters:
taxon - The taxon that is relatedTo
type - The type of SynonymRelationship (can be null)
Returns:
the number of SynonymRelationship instances

getSynonyms

List<SynonymRelationship> getSynonyms(Taxon taxon,
                                      SynonymRelationshipType type,
                                      Integer pageSize,
                                      Integer pageNumber,
                                      List<OrderHint> orderHints,
                                      List<String> propertyPaths)
Returns the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied taxon is relatedTo.

Parameters:
taxon - The taxon that is relatedTo
type - The type of SynonymRelationship (can be null)
pageSize - The maximum number of relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based) * @param orderHints Properties to order by
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a List of SynonymRelationship instances

countSynonyms

int countSynonyms(Synonym synonym,
                  SynonymRelationshipType type)
Returns a count of the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied synonym is relatedFrom.

Parameters:
taxon - The synonym that is relatedFrom
type - The type of SynonymRelationship (can be null)
Returns:
the number of SynonymRelationship instances

getSynonyms

List<SynonymRelationship> getSynonyms(Synonym synoynm,
                                      SynonymRelationshipType type,
                                      Integer pageSize,
                                      Integer pageNumber,
                                      List<OrderHint> orderHints,
                                      List<String> propertyPaths)
Returns the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied synonym is relatedFrom.

Parameters:
taxon - The synonym that is relatedFrom
type - The type of SynonymRelationship (can be null)
pageSize - The maximum number of relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based) * @param orderHints Properties to order by
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a List of SynonymRelationship instances

getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification

List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification)
Returns:

findIdenticalTaxonNames

List<TaxonNameBase> findIdenticalTaxonNames(List<String> propertyPath)
Creates all inferred synonyms for the species in the tree and insert it to the database

Parameters:
tree -
Returns:
List of inferred synonyms

getPhylumName

String getPhylumName(TaxonNameBase name)

countTaxaByCommonName

long countTaxaByCommonName(String searchString,
                           Classification classification,
                           MatchMode matchMode,
                           Set<NamedArea> namedAreas)

deleteSynonymRelationships

long deleteSynonymRelationships(Synonym syn,
                                Taxon taxon)
Deletes all synonym relationships of a given synonym. If taxon is given only those relationships to the taxon are deleted.

Parameters:
synonym - the synonym
taxon - the taxon, may be null
Returns:

findIdenticalTaxonNameIds

List<UUID> findIdenticalTaxonNameIds(List<String> propertyPath)

findIdenticalNamesNew

List<TaxonNameBase> findIdenticalNamesNew(List<String> propertyPaths)

countSynonymRelationships

Integer countSynonymRelationships(TaxonBase taxonBase,
                                  SynonymRelationshipType type,
                                  RelationshipBase.Direction relatedfrom)

getSynonymRelationships

List<SynonymRelationship> getSynonymRelationships(TaxonBase taxonBase,
                                                  SynonymRelationshipType type,
                                                  Integer pageSize,
                                                  Integer pageNumber,
                                                  List<OrderHint> orderHints,
                                                  List<String> propertyPaths,
                                                  RelationshipBase.Direction relatedfrom)

getUuidAndTitleCacheTaxon

List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheTaxon()
Returns:

getUuidAndTitleCacheSynonym

List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheSynonym()
Returns:

getTaxaByNameForEditor

List<UuidAndTitleCache<TaxonBase>> getTaxaByNameForEditor(boolean doTaxa,
                                                          boolean doSynonyms,
                                                          String queryString,
                                                          Classification classification,
                                                          MatchMode matchMode,
                                                          Set<NamedArea> namedAreas)

taxaByNameNotInDB

List<String> taxaByNameNotInDB(List<String> taxonNames)


Copyright © 2007-2013 EDIT. All Rights Reserved.