eu.etaxonomy.cdm.persistence.dao.hibernate.taxon
Class TaxonDaoHibernateImpl

java.lang.Object
  extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase
      extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase<T>
          extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase<T>
              extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.AnnotatableDaoImpl<T>
                  extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.IdentifiableDaoBase<TaxonBase>
                      extended by eu.etaxonomy.cdm.persistence.dao.hibernate.taxon.TaxonDaoHibernateImpl
All Implemented Interfaces:
IAnnotatableDao<TaxonBase>, ICdmEntityDao<TaxonBase>, IIdentifiableDao<TaxonBase>, ISearchableDao<TaxonBase>, ITitledDao<TaxonBase>, IVersionableDao<TaxonBase>, ITaxonDao

@Repository
@Qualifier(value="taxonDaoHibernateImpl")
public class TaxonDaoHibernateImpl
extends IdentifiableDaoBase<TaxonBase>
implements ITaxonDao

Version:
1.0
Author:
a.mueller

Nested Class Summary
 class TaxonDaoHibernateImpl.UuidAndTitleCacheOfAcceptedTaxon
           
 
Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.IdentifiableDaoBase
defaultField, indexedClasses
 
Fields inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase
defaultBeanInitializer, flushAfterNo, type, version
 
Constructor Summary
TaxonDaoHibernateImpl()
           
 
Method Summary
 int countAllRelationships()
           
 int countAllRelationships(Class<? extends RelationshipBase> clazz)
           
 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 genusOrUninomial, 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.
 UUID delete(TaxonBase taxonBase)
          Sets the taxonomic parent to null.
 long deleteSynonymRelationships(Synonym synonym, Taxon taxon)
          Deletes all synonym relationships of a given synonym.
 TaxonBase find(LSID lsid)
          Return an object by LSID.
 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> propertyPaths)
           
 List<TaxonNameBase> findIdenticalTaxonNames(List<String> propertyPaths)
          Creates all inferred synonyms for the species in the tree and insert it to the database
 List<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz, String genusOrUninomial, 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)
          Computes all Taxon instances which name is of a certain Rank.
 List<Taxon> getRootTaxa(Reference sec)
          Computes all Taxon instances that do not have a taxonomic parent and has at least one child.
 List<Taxon> getRootTaxa(Reference sec, CdmFetch cdmFetch, Boolean onlyWithChildren, Boolean withMisapplications)
          Computes all Taxon instances that do not have a taxonomic parent.
 List<SynonymRelationship> getSynonymRelationships(TaxonBase taxonBase, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths, RelationshipBase.Direction direction)
           
 List<SynonymRelationship> getSynonyms(Synonym synonym, 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<TaxonBase> getTaxaByCommonName(String queryString, Classification classification, MatchMode matchMode, Set<NamedArea> namedAreas, Integer pageSize, Integer pageNumber)
           
 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(boolean doTaxa, boolean doSynonyms, String queryString, MatchMode matchMode, Integer pageSize, Integer pageNumber)
           
 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 queryString, 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()
           
 void rebuildIndex()
          Index all T entities currently in the database (useful in concert with purgeIndex() to (re-)create indexes or in the case of corrupt indexes / mismatch between the database and the free-text indices)
 void setAlternativeSpellingSuggestionParser(AlternativeSpellingSuggestionParser<TaxonBase> alternativeSpellingSuggestionParser)
           
 String suggestQuery(String queryString)
          Suggest a query that will return hits based upon an existing lucene query string (that is presumably misspelt and returns no hits) Used to implement "did you mean?"-type functionality using the lucene spellchecker.
 List<String> taxaByNameNotInDB(List<String> taxonNames)
           
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.IdentifiableDaoBase
count, countByReferenceTitle, countByTitle, countByTitle, countByTitle, countByTitle, countRights, countSources, countTitleCache, findByReferenceTitle, findByTitle, findByTitle, findByTitle, findByTitle, findByTitleAndClass, findOriginalSourceByIdInSource, findTitleCache, getCredits, getRights, getSources, getUuidAndTitleCache, getUuidAndTitleCache, optimizeIndex, purgeIndex, search
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.AnnotatableDaoImpl
countAnnotations, countMarkers, countMarkers, getAnnotations, getMarkers, groupMarkers
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase
addCriteria, addOrder, checkNotInPriorView, count, count, count, countAuditEvents, countAuditEvents, countByParam, exists, findByParam, findByUuid, getAuditEventFromContext, getAuditEvents, getAuditEvents, getAuditReader, getNextAuditEvent, getPreviousAuditEvent, list, list, list, list, load, load
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase
addCriteria, addExample, addGroups, addOrder, clear, countGroups, findById, getSession, getType, group, list, list, list, list, listByIds, load, lock, merge, refresh, refresh, replace, rows, save, saveAll, saveCdmObj, saveOrUpdate, saveOrUpdateAll, setDefaultBeanInitializer, setPagingParameter, setPagingParameter, update
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase
addOrder, flush, getSessionFactory, setSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao
countByReferenceTitle, countByTitle, countRights, countSources, countTitleCache, 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, 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, search
 

Constructor Detail

TaxonDaoHibernateImpl

public TaxonDaoHibernateImpl()
Method Detail

setAlternativeSpellingSuggestionParser

public void setAlternativeSpellingSuggestionParser(AlternativeSpellingSuggestionParser<TaxonBase> alternativeSpellingSuggestionParser)

getRootTaxa

public List<Taxon> getRootTaxa(Reference sec)
Description copied from interface: ITaxonDao
Computes all Taxon instances that do not have a taxonomic parent and has at least one child.

Specified by:
getRootTaxa in interface ITaxonDao
Returns:
The List of root taxa.

getRootTaxa

public List<Taxon> getRootTaxa(Rank rank,
                               Reference sec,
                               CdmFetch cdmFetch,
                               Boolean onlyWithChildren,
                               Boolean withMisapplications,
                               List<String> propertyPaths)
Description copied from interface: ITaxonDao
Computes all Taxon instances which name is of a certain Rank.

Specified by:
getRootTaxa in interface ITaxonDao
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.
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.

getRootTaxa

public List<Taxon> getRootTaxa(Reference sec,
                               CdmFetch cdmFetch,
                               Boolean onlyWithChildren,
                               Boolean withMisapplications)
Description copied from interface: ITaxonDao
Computes all Taxon instances that do not have a taxonomic parent.

Specified by:
getRootTaxa in interface ITaxonDao
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.
Returns:
The List of root taxa.

getTaxaByName

public List<TaxonBase> getTaxaByName(String queryString,
                                     Reference sec)
Description copied from interface: ITaxonDao
Returns a list of TaxonBase instances where the taxon.titleCache property matches the name parameter, and taxon.sec matches the sec parameter.

Specified by:
getTaxaByName in interface ITaxonDao
Returns:

getTaxaByName

public List<TaxonBase> getTaxaByName(String queryString,
                                     Boolean accepted,
                                     Reference sec)
Description copied from interface: ITaxonDao
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.

Specified by:
getTaxaByName in interface ITaxonDao
Returns:

getTaxaByName

public List<TaxonBase> getTaxaByName(boolean doTaxa,
                                     boolean doSynonyms,
                                     String queryString,
                                     MatchMode matchMode,
                                     Integer pageSize,
                                     Integer pageNumber)

getTaxaByName

public List<TaxonBase> getTaxaByName(String queryString,
                                     MatchMode matchMode,
                                     Boolean accepted,
                                     Integer pageSize,
                                     Integer pageNumber)
Description copied from interface: ITaxonDao
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.

Specified by:
getTaxaByName in interface ITaxonDao
Returns:

getTaxaByName

public 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)
Description copied from interface: ITaxonDao
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.

Specified by:
getTaxaByName in interface ITaxonDao
classification - TODO
namedAreas - TODO
propertyPaths - TODO
Returns:
list of found taxa

getTaxaByNameForEditor

public List<UuidAndTitleCache<TaxonBase>> getTaxaByNameForEditor(boolean doTaxa,
                                                                 boolean doSynonyms,
                                                                 String queryString,
                                                                 Classification classification,
                                                                 MatchMode matchMode,
                                                                 Set<NamedArea> namedAreas)
Specified by:
getTaxaByNameForEditor in interface ITaxonDao

getTaxaByCommonName

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

countTaxaByName

public long countTaxaByName(boolean doTaxa,
                            boolean doSynonyms,
                            boolean doMisappliedNames,
                            String queryString,
                            Classification classification,
                            MatchMode matchMode,
                            Set<NamedArea> namedAreas)
Specified by:
countTaxaByName in interface ITaxonDao
classification - TODO
Returns:

getAllTaxonBases

public List<TaxonBase> getAllTaxonBases(Integer pagesize,
                                        Integer page)
Description copied from interface: ITaxonDao
TODO necessary?

Specified by:
getAllTaxonBases in interface ITaxonDao
Parameters:
pagesize - max maximum number of returned taxa
page - page to start, with 0 being first page
Returns:

getAllSynonyms

public List<Synonym> getAllSynonyms(Integer limit,
                                    Integer start)
Specified by:
getAllSynonyms in interface ITaxonDao
Returns:

getAllTaxa

public List<Taxon> getAllTaxa(Integer limit,
                              Integer start)
Specified by:
getAllTaxa in interface ITaxonDao
Returns:

getAllRelationships

public List<RelationshipBase> getAllRelationships(Integer limit,
                                                  Integer start)
Specified by:
getAllRelationships in interface ITaxonDao

delete

public UUID delete(TaxonBase taxonBase)
            throws org.springframework.dao.DataAccessException
Sets the taxonomic parent to null. Does not handle taxonomic relationships.

Specified by:
delete in interface ICdmEntityDao<TaxonBase>
Overrides:
delete in class CdmEntityDaoBase<TaxonBase>
Returns:
Throws:
org.springframework.dao.DataAccessException

findByNameTitleCache

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

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

Specified by:
findByNameTitleCache in interface ITaxonDao
queryString - the taqxon Name to search for
classification - TODO
namedAreas - TODO
Returns:

findByUuid

public TaxonBase findByUuid(UUID uuid,
                            List<org.hibernate.criterion.Criterion> criteria,
                            List<String> propertyPaths)
Description copied from interface: ITaxonDao
Returns a taxon corresponding to the given uuid

Specified by:
findByUuid in interface ITaxonDao
Parameters:
uuid - The uuid of the taxon requested
criteria - Custom criteria to be added to the default list of applied criteria.
Returns:

findByUuids

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

Specified by:
findByUuids in interface ITaxonDao
Returns:

countMatchesByName

public int countMatchesByName(String queryString,
                              MatchMode matchMode,
                              boolean onlyAcccepted)
Specified by:
countMatchesByName in interface ITaxonDao
Returns:

countMatchesByName

public int countMatchesByName(String queryString,
                              MatchMode matchMode,
                              boolean onlyAcccepted,
                              List<org.hibernate.criterion.Criterion> criteria)
Specified by:
countMatchesByName in interface ITaxonDao
Returns:

countTaxonRelationships

public int countTaxonRelationships(Taxon taxon,
                                   TaxonRelationshipType type,
                                   RelationshipBase.Direction direction)
Description copied from interface: ITaxonDao
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.

Specified by:
countTaxonRelationships in interface ITaxonDao
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

countSynonyms

public int countSynonyms(Taxon taxon,
                         SynonymRelationshipType type)
Description copied from interface: ITaxonDao
Returns a count of the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied taxon is relatedTo.

Specified by:
countSynonyms in interface ITaxonDao
Parameters:
taxon - The taxon that is relatedTo
type - The type of SynonymRelationship (can be null)
Returns:
the number of SynonymRelationship instances

countSynonyms

public int countSynonyms(Synonym synonym,
                         SynonymRelationshipType type)
Description copied from interface: ITaxonDao
Returns a count of the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied synonym is relatedFrom.

Specified by:
countSynonyms in interface ITaxonDao
type - The type of SynonymRelationship (can be null)
Returns:
the number of SynonymRelationship instances

countTaxaByName

public int countTaxaByName(Class<? extends TaxonBase> clazz,
                           String genusOrUninomial,
                           String infraGenericEpithet,
                           String specificEpithet,
                           String infraSpecificEpithet,
                           Rank rank)
Description copied from interface: ITaxonDao
Returns a count of TaxonBase instances where the taxon.name properties match the parameters passed.

Specified by:
countTaxaByName in interface ITaxonDao
Returns:
a count of TaxonBase instances

findTaxaByName

public List<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz,
                                      String genusOrUninomial,
                                      String infraGenericEpithet,
                                      String specificEpithet,
                                      String infraSpecificEpithet,
                                      Rank rank,
                                      Integer pageSize,
                                      Integer pageNumber)
Description copied from interface: ITaxonDao
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

Specified by:
findTaxaByName in interface ITaxonDao
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

getTaxonRelationships

public List<TaxonRelationship> getTaxonRelationships(Taxon taxon,
                                                     TaxonRelationshipType type,
                                                     Integer pageSize,
                                                     Integer pageNumber,
                                                     List<OrderHint> orderHints,
                                                     List<String> propertyPaths,
                                                     RelationshipBase.Direction direction)
Description copied from interface: ITaxonDao
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.

Specified by:
getTaxonRelationships in interface ITaxonDao
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

getSynonyms

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

Specified by:
getSynonyms in interface ITaxonDao
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

getSynonyms

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

Specified by:
getSynonyms in interface ITaxonDao
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

rebuildIndex

public void rebuildIndex()
Description copied from interface: ISearchableDao
Index all T entities currently in the database (useful in concert with purgeIndex() to (re-)create indexes or in the case of corrupt indexes / mismatch between the database and the free-text indices)

Specified by:
rebuildIndex in interface ISearchableDao<TaxonBase>
Overrides:
rebuildIndex in class IdentifiableDaoBase<TaxonBase>

suggestQuery

public String suggestQuery(String queryString)
Description copied from interface: ISearchableDao
Suggest a query that will return hits based upon an existing lucene query string (that is presumably misspelt and returns no hits) Used to implement "did you mean?"-type functionality using the lucene spellchecker.

Specified by:
suggestQuery in interface ISearchableDao<TaxonBase>
Overrides:
suggestQuery in class IdentifiableDaoBase<TaxonBase>
Parameters:
queryString - Query string to check
Returns:
a suggested query string that will return hits or null if no such alternative spelling can be found.

getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification

public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification)
Specified by:
getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification in interface ITaxonDao
Returns:

find

public TaxonBase find(LSID lsid)
Description copied from interface: IIdentifiableDao
Return an object by LSID. NOTE: Because of the fact that LSIDs are supposed to be globally resolvable, this method behaves in a different way to other methods In short, it attempts to find an object of type T in the current view using the LSID passed. If the LSID passed has a revision part, then this will be used in the query, but if not, then it is expected that the request is for the 'current' version of the object and the revision part will not be used as a matching criteria in the query. If the object does not appear in the current view (i.e. it has been deleted), then this method will search the history tables for a match, again using the revision if it exists, but ignoring it if not.

Specified by:
find in interface IIdentifiableDao<TaxonBase>
Overrides:
find in class IdentifiableDaoBase<TaxonBase>
Parameters:
lsid - a LifeScience Identifier identifying the desired object

getTaxaByCommonName

public List<TaxonBase> getTaxaByCommonName(String queryString,
                                           Classification classification,
                                           MatchMode matchMode,
                                           Set<NamedArea> namedAreas,
                                           Integer pageSize,
                                           Integer pageNumber)

countAllRelationships

public int countAllRelationships()
Specified by:
countAllRelationships in interface ITaxonDao

countAllRelationships

public int countAllRelationships(Class<? extends RelationshipBase> clazz)

taxaByNameNotInDB

public List<String> taxaByNameNotInDB(List<String> taxonNames)
Specified by:
taxaByNameNotInDB in interface ITaxonDao

findIdenticalTaxonNameIds

public List<UUID> findIdenticalTaxonNameIds(List<String> propertyPaths)
Specified by:
findIdenticalTaxonNameIds in interface ITaxonDao

findIdenticalTaxonNames

public List<TaxonNameBase> findIdenticalTaxonNames(List<String> propertyPaths)
Description copied from interface: ITaxonDao
Creates all inferred synonyms for the species in the tree and insert it to the database

Specified by:
findIdenticalTaxonNames in interface ITaxonDao
Returns:
List of inferred synonyms

findIdenticalNamesNew

public List<TaxonNameBase> findIdenticalNamesNew(List<String> propertyPaths)
Specified by:
findIdenticalNamesNew in interface ITaxonDao

getPhylumName

public String getPhylumName(TaxonNameBase name)
Specified by:
getPhylumName in interface ITaxonDao

countTaxaByCommonName

public long countTaxaByCommonName(String searchString,
                                  Classification classification,
                                  MatchMode matchMode,
                                  Set<NamedArea> namedAreas)
Specified by:
countTaxaByCommonName in interface ITaxonDao

deleteSynonymRelationships

public long deleteSynonymRelationships(Synonym synonym,
                                       Taxon taxon)
Description copied from interface: ITaxonDao
Deletes all synonym relationships of a given synonym. If taxon is given only those relationships to the taxon are deleted.

Specified by:
deleteSynonymRelationships in interface ITaxonDao
taxon - the taxon, may be null
Returns:

countSynonymRelationships

public Integer countSynonymRelationships(TaxonBase taxonBase,
                                         SynonymRelationshipType type,
                                         RelationshipBase.Direction relatedfrom)
Specified by:
countSynonymRelationships in interface ITaxonDao

getSynonymRelationships

public List<SynonymRelationship> getSynonymRelationships(TaxonBase taxonBase,
                                                         SynonymRelationshipType type,
                                                         Integer pageSize,
                                                         Integer pageNumber,
                                                         List<OrderHint> orderHints,
                                                         List<String> propertyPaths,
                                                         RelationshipBase.Direction direction)
Specified by:
getSynonymRelationships in interface ITaxonDao

getUuidAndTitleCacheTaxon

public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheTaxon()
Specified by:
getUuidAndTitleCacheTaxon in interface ITaxonDao
Returns:

getUuidAndTitleCacheSynonym

public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheSynonym()
Specified by:
getUuidAndTitleCacheSynonym in interface ITaxonDao
Returns:


Copyright © 2007-2013 EDIT. All Rights Reserved.