eu.etaxonomy.cdm.api.service
Class NameServiceImpl

java.lang.Object
  extended by eu.etaxonomy.cdm.api.service.ServiceBase<T,DAO>
      extended by eu.etaxonomy.cdm.api.service.VersionableServiceBase<T,DAO>
          extended by eu.etaxonomy.cdm.api.service.AnnotatableServiceBase<T,DAO>
              extended by eu.etaxonomy.cdm.api.service.IdentifiableServiceBase<TaxonNameBase,ITaxonNameDao>
                  extended by eu.etaxonomy.cdm.api.service.NameServiceImpl
All Implemented Interfaces:
IAnnotatableService<TaxonNameBase>, IIdentifiableEntityService<TaxonNameBase>, INameService, IService<TaxonNameBase>, IVersionableService<TaxonNameBase>, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Service
@Transactional(readOnly=true)
public class NameServiceImpl
extends IdentifiableServiceBase<TaxonNameBase,ITaxonNameDao>
implements INameService


Field Summary
protected  IOrderedTermVocabularyDao orderedVocabularyDao
           
protected  IReferencedEntityDao<ReferencedEntityBase> referencedEntityDao
           
protected  ITermVocabularyDao vocabularyDao
           
 
Fields inherited from class eu.etaxonomy.cdm.api.service.IdentifiableServiceBase
commonService, UPDATE_TITLE_CACHE_DEFAULT_STEP_SIZE
 
Fields inherited from class eu.etaxonomy.cdm.api.service.ServiceBase
appContext, dao
 
Constructor Summary
NameServiceImpl()
          Constructor
 
Method Summary
 UUID delete(TaxonNameBase name)
          Delete an existing persistent object
 UUID delete(TaxonNameBase name, NameDeletionConfigurator config)
          Deletes a name.
 void deleteTypeDesignation(TaxonNameBase name, TypeDesignationBase typeDesignation)
          Removes the given type designation from the given taxon name and deletes it from the database if it is not connected to any other name.
 Pager<TaxonNameBase> findByName(Class<? extends TaxonNameBase> clazz, String queryString, MatchMode matchmode, List<org.hibernate.criterion.Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a Pager of names matching the given query string, optionally filtered by class, optionally with a particular MatchMode
 List<SearchResult<TaxonNameBase>> findByNameFuzzySearch(String name, float accuracy, List<Language> languages, boolean highlightFragments, List<String> propertyPaths, int maxNoOfResults)
          Fuzzy matching for the taxon name elements.
 HomotypicalGroup findHomotypicalGroup(UUID uuid)
          Returns a homotypical group with the given UUID or null if not homotypical group exists with that UUID
 NonViralName findNameByUuid(UUID uuid, List<String> propertyPaths)
          Deprecated. To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions Replace by load(UUID, propertyPaths)
 List<NonViralName> findNamesByNameCache(String nameCache, MatchMode matchMode, List<String> propertyPaths)
          TODO candidate for harmonization new name saveHomotypicalGroups findByTitle
 List findNamesByTitle(String title)
          Deprecated. To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions duplicate of findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths)
 List findNamesByTitle(String title, CdmBase sessionObject)
          Deprecated. To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions duplicate of findByTitle()
 List<NonViralName> findNamesByTitleCache(String titleCache, MatchMode matchMode, List<String> propertyPaths)
          TODO candidate for harmonization new name saveHomotypicalGroups findByTitle
 List<HomotypicalGroup> getAllHomotypicalGroups(int limit, int start)
          FIXME Candidate for harmonization homotypicalGroupService.list
 List<TaxonNameBase> getAllNames(int limit, int start)
          TODO candidate for harmonization new name getNames
 List<NomenclaturalStatus> getAllNomenclaturalStatus(int limit, int start)
          TODO candidate for harmonization new name getNomenclaturalStatus
 List<RelationshipBase> getAllRelationships(int limit, int start)
          Deprecated. 
 List<TypeDesignationBase> getAllTypeDesignations(int limit, int start)
          TODO candidate for harmonization new name getTypeDesignations
 Pager<HybridRelationship> getHybridNames(NonViralName name, HybridRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a List of hybrids related to this name, optionally filtered by hybrid relationship type
 TermVocabulary<NameRelationshipType> getNameRelationshipTypeVocabulary()
          FIXME Candidate for harmonization is this the same as termService.getVocabulary(VocabularyEnum.NameRelationshipType) (non-Javadoc)
 List getNamesByName(String name)
          Deprecated. To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions duplicate of findByName
 List getNamesByName(String name, CdmBase sessionObject)
          TODO candidate for harmonization
 List<NonViralName> getNamesByNameCache(String nameCache)
          TODO candidate for harmonization new name findByName
 OrderedTermVocabulary<Rank> getRankVocabulary()
          FIXME Candidate for harmonization is this not the same as termService.getVocabulary(VocabularyEnum.Rank) since this returns OrderedTermVocabulary (non-Javadoc)
 TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary()
          FIXME Candidate for harmonization is this the same as termService.getVocabulary(VocabularyEnum.SpecimenTypeDesignationStatus) (non-Javadoc)
 OrderedTermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationVocabulary()
          FIXME Candidate for harmonization is this the same as termService.getVocabulary(VocabularyEnum.SpecimenTypeDesignationStatus) and also seems to duplicate the above method, differing only in the DAO used and the return type (non-Javadoc)
 TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary()
          FIXME Candidate for harmonization is this the same as termService.getVocabulary(VocabularyEnum.StatusType) (non-Javadoc)
 List<TaggedText> getTaggedName(UUID uuid)
           
 Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber)
          Return a List of types related to this name, optionally filtered by type designation status
 Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
           
 List<UuidAndTitleCache> getUuidAndTitleCacheOfNames()
          Returns a map that holds uuid, titleCache pairs of all names in the current database
 List<NameRelationship> listFromNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a List of relationships in which this name is related to another name, optionally filtered by relationship type
 List<NameRelationship> listNameRelationships(TaxonNameBase name, RelationshipBase.Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a List of name relationships in which this name is related to another name, optionally filtered by relationship type
 List<NameRelationship> listToNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a List of relationships in which another name is related to this name, optionally filtered by relationship type
 Pager<NameRelationship> pageFromNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a List of relationships in which this name is related to another name, optionally filtered by relationship type
 Pager<NameRelationship> pageNameRelationships(TaxonNameBase name, RelationshipBase.Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a List of name relationships in which this name is related to another name, optionally filtered by relationship type
 Pager<NameRelationship> pageToNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a List of relationships in which another name is related to this name, optionally filtered by relationship type
protected  LuceneSearch prepareFindByFuzzySearch(Class<? extends CdmBase> clazz, NonViralName nvn, float accuracy, List<Language> languages, boolean highlightFragments)
           
 Map<UUID,HomotypicalGroup> saveAllHomotypicalGroups(Collection<HomotypicalGroup> homotypicalGroups)
          TODO candidate for harmonization new name saveHomotypicalGroups
 Map<UUID,ReferencedEntityBase> saveReferencedEntitiesAll(Collection<ReferencedEntityBase> referencedEntityCollection)
          TODO candidate for harmonization new name saveReferencedEntities
 Map<UUID,TypeDesignationBase> saveTypeDesignationAll(Collection<TypeDesignationBase> typeDesignationCollection)
          TODO candidate for harmonization new name saveTypeDesignations
 Pager<TaxonNameBase> searchNames(String uninomial, String infraGenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          FIXME Candidate for harmonization rename search
protected  void setDao(ITaxonNameDao dao)
           
protected  void setOtherCachesNull(TaxonNameBase name)
          Needs override if not only the title cache should be set to null to generate the correct new title cache
 void updateTitleCache(Class<? extends TaxonNameBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<TaxonNameBase> cacheStrategy, IProgressMonitor monitor)
          (Re-)generate the title caches for all objects of this concrete IdentifiableEntity class
 
Methods inherited from class eu.etaxonomy.cdm.api.service.IdentifiableServiceBase
countByTitle, countByTitle, deduplicate, find, findByTitle, findByTitle, findCdmObjectsByTitle, findCdmObjectsByTitle, findCdmObjectsByTitle, findTitleCache, getRights, getSourcedObjectByIdInSource, getSources, getUuidAndTitleCache, listByReferenceTitle, listByTitle, replace, search, updateTitleCache, updateTitleCacheImpl
 
Methods inherited from class eu.etaxonomy.cdm.api.service.AnnotatableServiceBase
countMarkers, getAnnotations, getMarkers, groupMarkers
 
Methods inherited from class eu.etaxonomy.cdm.api.service.VersionableServiceBase
getNextAuditEvent, getPreviousAuditEvent, pageAuditEvents, pageAuditEvents
 
Methods inherited from class eu.etaxonomy.cdm.api.service.ServiceBase
clear, count, exists, find, find, find, findById, getSession, group, list, list, load, load, lock, merge, page, refresh, refresh, rows, save, save, saveOrUpdate, saveOrUpdate, setApplicationContext, update
 
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.api.service.INameService
search
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IIdentifiableEntityService
countByTitle, countByTitle, deduplicate, find, findByTitle, findByTitle, findTitleCache, getRights, getSourcedObjectByIdInSource, getSources, getUuidAndTitleCache, listByReferenceTitle, listByTitle, replace, updateTitleCache
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IAnnotatableService
countMarkers, getAnnotations, getMarkers, groupMarkers
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IVersionableService
getNextAuditEvent, getPreviousAuditEvent, pageAuditEvents, pageAuditEvents
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IService
clear, count, exists, find, find, find, findById, getSession, group, list, list, load, load, lock, merge, page, refresh, refresh, rows, save, save, saveOrUpdate, saveOrUpdate, update
 

Field Detail

vocabularyDao

@Autowired
protected ITermVocabularyDao vocabularyDao

orderedVocabularyDao

@Autowired
protected IOrderedTermVocabularyDao orderedVocabularyDao

referencedEntityDao

@Autowired
@Qualifier(value="refEntDao")
protected IReferencedEntityDao<ReferencedEntityBase> referencedEntityDao
Constructor Detail

NameServiceImpl

public NameServiceImpl()
Constructor

Method Detail

delete

public UUID delete(TaxonNameBase name)
Description copied from interface: IService
Delete an existing persistent object

Specified by:
delete in interface IService<TaxonNameBase>
Overrides:
delete in class ServiceBase<TaxonNameBase,ITaxonNameDao>
Parameters:
name - the object to be deleted
Returns:
the unique identifier of the deleted entity

delete

public UUID delete(TaxonNameBase name,
                   NameDeletionConfigurator config)
            throws ReferencedObjectUndeletableException
Description copied from interface: INameService
Deletes a name. Depening on the configurator state links to the name will either be deleted or throw exceptions.
If name is null this method has no effect.

Specified by:
delete in interface INameService
Throws:
ReferencedObjectUndeletableException

deleteTypeDesignation

public void deleteTypeDesignation(TaxonNameBase name,
                                  TypeDesignationBase typeDesignation)
Description copied from interface: INameService
Removes the given type designation from the given taxon name and deletes it from the database if it is not connected to any other name. If typeDesignation is null all type designations are deleted from the given taxon name. If name is null all names are removed from the given type designation. If both are null nothing happens.

Specified by:
deleteTypeDesignation in interface INameService

getNamesByName

@Deprecated
public List getNamesByName(String name)
Deprecated. To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions duplicate of findByName

Specified by:
getNamesByName in interface INameService
Returns:

getNamesByNameCache

public List<NonViralName> getNamesByNameCache(String nameCache)
TODO candidate for harmonization new name findByName

Specified by:
getNamesByNameCache in interface INameService
Returns:

findNamesByTitleCache

public List<NonViralName> findNamesByTitleCache(String titleCache,
                                                MatchMode matchMode,
                                                List<String> propertyPaths)
TODO candidate for harmonization new name saveHomotypicalGroups findByTitle

Specified by:
findNamesByTitleCache in interface INameService
Returns:

findNamesByNameCache

public List<NonViralName> findNamesByNameCache(String nameCache,
                                               MatchMode matchMode,
                                               List<String> propertyPaths)
TODO candidate for harmonization new name saveHomotypicalGroups findByTitle

Specified by:
findNamesByNameCache in interface INameService
Returns:

findNameByUuid

@Deprecated
public NonViralName findNameByUuid(UUID uuid,
                                              List<String> propertyPaths)
Deprecated. To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions Replace by load(UUID, propertyPaths)

Description copied from interface: INameService
Returns the NonViralName with the given UUID using the given match mode and initialization strategy

Specified by:
findNameByUuid in interface INameService
Returns:

getNamesByName

public List getNamesByName(String name,
                           CdmBase sessionObject)
TODO candidate for harmonization

Specified by:
getNamesByName in interface INameService
sessionObject - An object that is attached to the session before executing the query
Returns:

findNamesByTitle

@Deprecated
public List findNamesByTitle(String title)
Deprecated. To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions duplicate of findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths)

Specified by:
findNamesByTitle in interface INameService

findNamesByTitle

@Deprecated
public List findNamesByTitle(String title,
                                        CdmBase sessionObject)
Deprecated. To be removed for harmonization see http://dev.e-taxonomy.eu/trac/wiki/CdmLibraryConventions duplicate of findByTitle()

Specified by:
findNamesByTitle in interface INameService

saveAllHomotypicalGroups

@Transactional(readOnly=false)
public Map<UUID,HomotypicalGroup> saveAllHomotypicalGroups(Collection<HomotypicalGroup> homotypicalGroups)
TODO candidate for harmonization new name saveHomotypicalGroups

Specified by:
saveAllHomotypicalGroups in interface INameService
Returns:

saveTypeDesignationAll

@Transactional(readOnly=false)
public Map<UUID,TypeDesignationBase> saveTypeDesignationAll(Collection<TypeDesignationBase> typeDesignationCollection)
TODO candidate for harmonization new name saveTypeDesignations

Specified by:
saveTypeDesignationAll in interface INameService
Returns:

saveReferencedEntitiesAll

@Transactional(readOnly=false)
public Map<UUID,ReferencedEntityBase> saveReferencedEntitiesAll(Collection<ReferencedEntityBase> referencedEntityCollection)
TODO candidate for harmonization new name saveReferencedEntities

Specified by:
saveReferencedEntitiesAll in interface INameService

getAllNames

public List<TaxonNameBase> getAllNames(int limit,
                                       int start)
TODO candidate for harmonization new name getNames


getAllNomenclaturalStatus

public List<NomenclaturalStatus> getAllNomenclaturalStatus(int limit,
                                                           int start)
TODO candidate for harmonization new name getNomenclaturalStatus

Specified by:
getAllNomenclaturalStatus in interface INameService
Returns:

getAllTypeDesignations

public List<TypeDesignationBase> getAllTypeDesignations(int limit,
                                                        int start)
TODO candidate for harmonization new name getTypeDesignations

Specified by:
getAllTypeDesignations in interface INameService
Returns:

getAllHomotypicalGroups

public List<HomotypicalGroup> getAllHomotypicalGroups(int limit,
                                                      int start)
FIXME Candidate for harmonization homotypicalGroupService.list

Specified by:
getAllHomotypicalGroups in interface INameService

getAllRelationships

@Deprecated
public List<RelationshipBase> getAllRelationships(int limit,
                                                             int start)
Deprecated. 

FIXME Candidate for harmonization remove

Specified by:
getAllRelationships in interface INameService

getRankVocabulary

public OrderedTermVocabulary<Rank> getRankVocabulary()
FIXME Candidate for harmonization is this not the same as termService.getVocabulary(VocabularyEnum.Rank) since this returns OrderedTermVocabulary (non-Javadoc)

Specified by:
getRankVocabulary in interface INameService
Returns:
See Also:
INameService.getRankVocabulary()

getNameRelationshipTypeVocabulary

public TermVocabulary<NameRelationshipType> getNameRelationshipTypeVocabulary()
FIXME Candidate for harmonization is this the same as termService.getVocabulary(VocabularyEnum.NameRelationshipType) (non-Javadoc)

Specified by:
getNameRelationshipTypeVocabulary in interface INameService
Returns:
See Also:
INameService.getNameRelationshipTypeVocabulary()

getStatusTypeVocabulary

public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary()
FIXME Candidate for harmonization is this the same as termService.getVocabulary(VocabularyEnum.StatusType) (non-Javadoc)

Specified by:
getStatusTypeVocabulary in interface INameService
Returns:
See Also:
INameService.getStatusTypeVocabulary()

getSpecimenTypeDesignationStatusVocabulary

public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary()
FIXME Candidate for harmonization is this the same as termService.getVocabulary(VocabularyEnum.SpecimenTypeDesignationStatus) (non-Javadoc)

Specified by:
getSpecimenTypeDesignationStatusVocabulary in interface INameService
Returns:
See Also:
eu.etaxonomy.cdm.api.service.INameService#getTypeDesignationStatusVocabulary()

getSpecimenTypeDesignationVocabulary

public OrderedTermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationVocabulary()
FIXME Candidate for harmonization is this the same as termService.getVocabulary(VocabularyEnum.SpecimenTypeDesignationStatus) and also seems to duplicate the above method, differing only in the DAO used and the return type (non-Javadoc)

Specified by:
getSpecimenTypeDesignationVocabulary in interface INameService
Returns:
See Also:
eu.etaxonomy.cdm.api.service.INameService#getTypeDesignationStatusVocabulary()

setDao

@Autowired
protected void setDao(ITaxonNameDao dao)
Specified by:
setDao in class ServiceBase<TaxonNameBase,ITaxonNameDao>

getHybridNames

public Pager<HybridRelationship> getHybridNames(NonViralName name,
                                                HybridRelationshipType type,
                                                Integer pageSize,
                                                Integer pageNumber,
                                                List<OrderHint> orderHints,
                                                List<String> propertyPaths)
Description copied from interface: INameService
Return a List of hybrids related to this name, optionally filtered by hybrid relationship type

Specified by:
getHybridNames in interface INameService
Parameters:
name - the name
type - the hybrid relationship type (or null to return all hybrids)
pageSize - The maximum number of hybrid relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of HybridRelationship instances

listNameRelationships

public List<NameRelationship> listNameRelationships(TaxonNameBase name,
                                                    RelationshipBase.Direction direction,
                                                    NameRelationshipType type,
                                                    Integer pageSize,
                                                    Integer pageNumber,
                                                    List<OrderHint> orderHints,
                                                    List<String> propertyPaths)
Description copied from interface: INameService
Return a List of name relationships in which this name is related to another name, optionally filtered by relationship type

Specified by:
listNameRelationships in interface INameService
Parameters:
name - the name on either the "from side" or on the "to side" of the relationship, depending on the direction of the relationship.
direction - the direction of the NameRelationship, may be null to return all relationships
type - the relationship type (or null to return all relationships)
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 - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of NameRelationship instances

prepareFindByFuzzySearch

protected LuceneSearch prepareFindByFuzzySearch(Class<? extends CdmBase> clazz,
                                                NonViralName nvn,
                                                float accuracy,
                                                List<Language> languages,
                                                boolean highlightFragments)

findByNameFuzzySearch

public List<SearchResult<TaxonNameBase>> findByNameFuzzySearch(String name,
                                                               float accuracy,
                                                               List<Language> languages,
                                                               boolean highlightFragments,
                                                               List<String> propertyPaths,
                                                               int maxNoOfResults)
                                                        throws org.apache.lucene.index.CorruptIndexException,
                                                               IOException,
                                                               org.apache.lucene.queryParser.ParseException
Description copied from interface: INameService
Fuzzy matching for the taxon name elements. The input name is first atomised using the NonViralNameParserImpl into its separate parts (genusOrUninomial,infraGenericEpithet,specificEpithet,infraGenericEpithet,authorshipCache). Each field is then matched separately with the same accuracy parameter.

Specified by:
findByNameFuzzySearch in interface INameService
Parameters:
name - taxon name to fuzzy match
accuracy - value > 0.0 and < 1.0 which determines the accuracy of the result.
languages - list of languages to consider when matching (currently not used)
Returns:
Throws:
org.apache.lucene.index.CorruptIndexException
IOException
org.apache.lucene.queryParser.ParseException

pageNameRelationships

public Pager<NameRelationship> pageNameRelationships(TaxonNameBase name,
                                                     RelationshipBase.Direction direction,
                                                     NameRelationshipType type,
                                                     Integer pageSize,
                                                     Integer pageNumber,
                                                     List<OrderHint> orderHints,
                                                     List<String> propertyPaths)
Description copied from interface: INameService
Return a List of name relationships in which this name is related to another name, optionally filtered by relationship type

Specified by:
pageNameRelationships in interface INameService
Parameters:
name - the name on the "from side" of the relationship
direction - the direction of the NameRelationship
type - the relationship type (or null to return all relationships)
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 - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of NameRelationship instances

listFromNameRelationships

public List<NameRelationship> listFromNameRelationships(TaxonNameBase name,
                                                        NameRelationshipType type,
                                                        Integer pageSize,
                                                        Integer pageNumber,
                                                        List<OrderHint> orderHints,
                                                        List<String> propertyPaths)
Description copied from interface: INameService
Return a List of relationships in which this name is related to another name, optionally filtered by relationship type

Specified by:
listFromNameRelationships in interface INameService
Parameters:
name - the name on the "from side" of the relationship
type - the relationship type (or null to return all relationships)
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 - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of NameRelationship instances

pageFromNameRelationships

public Pager<NameRelationship> pageFromNameRelationships(TaxonNameBase name,
                                                         NameRelationshipType type,
                                                         Integer pageSize,
                                                         Integer pageNumber,
                                                         List<OrderHint> orderHints,
                                                         List<String> propertyPaths)
Description copied from interface: INameService
Return a List of relationships in which this name is related to another name, optionally filtered by relationship type

Specified by:
pageFromNameRelationships in interface INameService
Parameters:
name - the name on the "from side" of the relationship
type - the relationship type (or null to return all relationships)
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 - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of NameRelationship instances

listToNameRelationships

public List<NameRelationship> listToNameRelationships(TaxonNameBase name,
                                                      NameRelationshipType type,
                                                      Integer pageSize,
                                                      Integer pageNumber,
                                                      List<OrderHint> orderHints,
                                                      List<String> propertyPaths)
Description copied from interface: INameService
Return a List of relationships in which another name is related to this name, optionally filtered by relationship type

Specified by:
listToNameRelationships in interface INameService
Parameters:
name - the name on the "to side" of the relationship
type - the relationship type (or null to return all relationships)
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 - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of NameRelationship instances

pageToNameRelationships

public Pager<NameRelationship> pageToNameRelationships(TaxonNameBase name,
                                                       NameRelationshipType type,
                                                       Integer pageSize,
                                                       Integer pageNumber,
                                                       List<OrderHint> orderHints,
                                                       List<String> propertyPaths)
Description copied from interface: INameService
Return a List of relationships in which another name is related to this name, optionally filtered by relationship type

Specified by:
pageToNameRelationships in interface INameService
Parameters:
name - the name on the "to side" of the relationship
type - the relationship type (or null to return all relationships)
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 - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of NameRelationship instances

getTypeDesignations

public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name,
                                                      SpecimenTypeDesignationStatus status,
                                                      Integer pageSize,
                                                      Integer pageNumber)
Description copied from interface: INameService
Return a List of types related to this name, optionally filtered by type designation status

Specified by:
getTypeDesignations in interface INameService
Parameters:
name - the name
status - the type designation status (or null to return all types)
pageSize - The maximum number of types returned (can be null for all types)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
Returns:
a Pager of TypeDesignationBase instances

getTypeDesignations

public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name,
                                                      SpecimenTypeDesignationStatus status,
                                                      Integer pageSize,
                                                      Integer pageNumber,
                                                      List<String> propertyPaths)
Specified by:
getTypeDesignations in interface INameService

searchNames

public Pager<TaxonNameBase> searchNames(String uninomial,
                                        String infraGenericEpithet,
                                        String specificEpithet,
                                        String infraspecificEpithet,
                                        Rank rank,
                                        Integer pageSize,
                                        Integer pageNumber,
                                        List<OrderHint> orderHints,
                                        List<String> propertyPaths)
FIXME Candidate for harmonization rename search

Specified by:
searchNames in interface INameService
pageSize - The maximum number of names returned (can be null for all names)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of TaxonNameBase instances

getUuidAndTitleCacheOfNames

public List<UuidAndTitleCache> getUuidAndTitleCacheOfNames()
Description copied from interface: INameService
Returns a map that holds uuid, titleCache pairs of all names in the current database

Specified by:
getUuidAndTitleCacheOfNames in interface INameService
Returns:
a Map containing uuid and titleCache of names

findByName

public Pager<TaxonNameBase> findByName(Class<? extends TaxonNameBase> clazz,
                                       String queryString,
                                       MatchMode matchmode,
                                       List<org.hibernate.criterion.Criterion> criteria,
                                       Integer pageSize,
                                       Integer pageNumber,
                                       List<OrderHint> orderHints,
                                       List<String> propertyPaths)
Description copied from interface: INameService
Return a Pager of names matching the given query string, optionally filtered by class, optionally with a particular MatchMode

Specified by:
findByName in interface INameService
Parameters:
clazz - filter by class - can be null to include all instances of type T
queryString - the query string to filter by
matchmode - use a particular type of matching (can be null - defaults to exact matching)
criteria - additional criteria to filter by
pageSize - The maximum number of objects returned (can be null for all objects)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - Supports path like orderHints.propertyNames which include *-to-one properties like createdBy.username or authorTeam.persistentTitleCache
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a paged list of instances of type T matching the queryString

findHomotypicalGroup

public HomotypicalGroup findHomotypicalGroup(UUID uuid)
Description copied from interface: INameService
Returns a homotypical group with the given UUID or null if not homotypical group exists with that UUID

Specified by:
findHomotypicalGroup in interface INameService
Parameters:
uuid - the uuid of the homotypical group
Returns:
a homotypical group

updateTitleCache

@Transactional(readOnly=false)
public void updateTitleCache(Class<? extends TaxonNameBase> clazz,
                                           Integer stepSize,
                                           IIdentifiableEntityCacheStrategy<TaxonNameBase> cacheStrategy,
                                           IProgressMonitor monitor)
Description copied from interface: IIdentifiableEntityService
(Re-)generate the title caches for all objects of this concrete IdentifiableEntity class

Specified by:
updateTitleCache in interface IIdentifiableEntityService<TaxonNameBase>
Parameters:
clazz - class of objects to be updated
stepSize - number of objects loaded per step. If null use default.
cacheStrategy - cachestrategy used for title cache. If null use default.
monitor - progress monitor. If null use default.

setOtherCachesNull

protected void setOtherCachesNull(TaxonNameBase name)
Description copied from class: IdentifiableServiceBase
Needs override if not only the title cache should be set to null to generate the correct new title cache

Overrides:
setOtherCachesNull in class IdentifiableServiceBase<TaxonNameBase,ITaxonNameDao>

getTaggedName

public List<TaggedText> getTaggedName(UUID uuid)
Specified by:
getTaggedName in interface INameService
Returns:


Copyright © 2007-2013 EDIT. All Rights Reserved.