eu.etaxonomy.cdm.api.service
Interface IIdentifiableEntityService<T extends IdentifiableEntity>

All Superinterfaces:
IAnnotatableService<T>, IService<T>, IVersionableService<T>
All Known Subinterfaces:
IAgentService, IClassificationService, ICollectionService, IDescriptionService, IFeatureTreeService, IMediaService, INameService, IOccurrenceService, IPolytomousKeyService, IReferenceService, ITaxonService, ITermService, IVocabularyService
All Known Implementing Classes:
AgentServiceImpl, ClassificationServiceImpl, CollectionServiceImpl, DescriptionServiceImpl, FeatureTreeServiceImpl, IdentifiableServiceBase, MediaServiceImpl, NameServiceImpl, OccurrenceServiceImpl, PolytomousKeyServiceImpl, ReferenceServiceImpl, TaxonServiceImpl, TermServiceImpl, VocabularyServiceImpl

public interface IIdentifiableEntityService<T extends IdentifiableEntity>
extends IAnnotatableService<T>


Method Summary
 Integer countByTitle(Class<? extends T> clazz, String queryString, MatchMode matchmode, List<org.hibernate.criterion.Criterion> criteria)
          Return an Integer of how many objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode
 Integer countByTitle(IIdentifiableEntityServiceConfigurator<T> configurator)
          Return an Integer of how many objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode
 int deduplicate(Class<? extends T> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy)
          This method tries to deduplicate all objects of a certain class by first trying to find matchabel objects and merging them in a second step.
 T find(LSID lsid)
          Finds an object with a given LSID.
 Pager<T> findByTitle(Class<? extends T> 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 objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode
 Pager<T> findByTitle(IIdentifiableEntityServiceConfigurator<T> configurator)
          Return a Pager of objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode
 Pager<T> findTitleCache(Class<? extends T> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode)
          Return a Pager of objects with distinct titleCache strings filtered by the given query string, optionally filtered by class, optionally with a particular MatchMode
 Pager<Rights> getRights(T t, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Return a Pager of rights belonging to this object
 ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace)
           
 Pager<IdentifiableSource> getSources(T t, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Return a Pager of sources belonging to this object
 List<UuidAndTitleCache<T>> getUuidAndTitleCache()
          Return a list of all uuids mapped to titleCache in the convenient UuidAndTitleCache object.
 List<T> listByReferenceTitle(Class<? extends T> clazz, String queryString, MatchMode matchmode, List<org.hibernate.criterion.Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a List of objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode
 List<T> listByTitle(Class<? extends T> clazz, String queryString, MatchMode matchmode, List<org.hibernate.criterion.Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a List of objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode
 T replace(T x, T y)
          Replaces all *ToMany and *ToOne references to an object (x) with another object of the same type (y) Ignores ManyToAny and OneToAny relationships as these are typically involved with bidirectional parent-child relations
 Pager<T> search(Class<? extends T> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns a Paged List of IdentifiableEntity instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
 void updateTitleCache()
          (Re-)generate the title caches for all objects of this concrete IdentifiableEntity class.
 void updateTitleCache(Class<? extends T> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<T> cacheStrategy, IProgressMonitor monitor)
          (Re-)generate the title caches for all objects of this concrete IdentifiableEntity class
 
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, delete, exists, find, find, find, findById, getSession, group, list, list, load, load, lock, merge, page, refresh, refresh, rows, save, save, saveOrUpdate, saveOrUpdate, update
 

Method Detail

updateTitleCache

void updateTitleCache()
(Re-)generate the title caches for all objects of this concrete IdentifiableEntity class. Uses default values.

See Also:
updateTitleCache(Class, Integer, IIdentifiableEntityCacheStrategy, IProgressMonitor)

updateTitleCache

void updateTitleCache(Class<? extends T> clazz,
                      Integer stepSize,
                      IIdentifiableEntityCacheStrategy<T> cacheStrategy,
                      IProgressMonitor monitor)
(Re-)generate the title caches for all objects of this concrete IdentifiableEntity class

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.

find

T find(LSID lsid)
Finds an object with a given LSID. If the object does not currently exist in the current view, then the most recent prior version of the object will be returned, or null if an object with this identifier has never existed

Parameters:
lsid -
Returns:
an object of type T or null of the object has never existed

replace

T replace(T x,
          T y)
Replaces all *ToMany and *ToOne references to an object (x) with another object of the same type (y) Ignores ManyToAny and OneToAny relationships as these are typically involved with bidirectional parent-child relations

Parameters:
x -
y -
Returns:
the replacing object (y)

getSources

Pager<IdentifiableSource> getSources(T t,
                                     Integer pageSize,
                                     Integer pageNumber,
                                     List<String> propertyPaths)
Return a Pager of sources belonging to this object

Parameters:
t - The identifiable entity
pageSize - The maximum number of sources returned (can be null for all sources)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of OriginalSource entities

getRights

Pager<Rights> getRights(T t,
                        Integer pageSize,
                        Integer pageNumber,
                        List<String> propertyPaths)
Return a Pager of rights belonging to this object

Parameters:
t - The identifiable entity
pageSize - The maximum number of rights returned (can be null for all rights)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of Rights entities

getSourcedObjectByIdInSource

ISourceable getSourcedObjectByIdInSource(Class clazz,
                                         String idInSource,
                                         String idNamespace)

getUuidAndTitleCache

List<UuidAndTitleCache<T>> getUuidAndTitleCache()
Return a list of all uuids mapped to titleCache in the convenient UuidAndTitleCache object. Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness objects. To be used in cases where you want to present large amount of data and provide details after a selection has been made.

Returns:
a list of UuidAndTitleCache instances

findByTitle

Pager<T> findByTitle(Class<? extends T> 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 objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode

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)
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
orderHints - Supports path like orderHints.propertyNames which include *-to-one properties like createdBy.username or authorTeam.persistentTitleCache
Returns:
a paged list of instances of type T matching the queryString

findByTitle

Pager<T> findByTitle(IIdentifiableEntityServiceConfigurator<T> configurator)
Return a Pager of objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode

Returns:
a paged list of instances of type T matching the queryString

countByTitle

Integer countByTitle(Class<? extends T> clazz,
                     String queryString,
                     MatchMode matchmode,
                     List<org.hibernate.criterion.Criterion> criteria)
Return an Integer of how many objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode

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
Returns:

countByTitle

Integer countByTitle(IIdentifiableEntityServiceConfigurator<T> configurator)
Return an Integer of how many objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode

Parameters:
configurator - an IIdentifiableEntityServiceConfigurator object
Returns:

listByTitle

List<T> listByTitle(Class<? extends T> clazz,
                    String queryString,
                    MatchMode matchmode,
                    List<org.hibernate.criterion.Criterion> criteria,
                    Integer pageSize,
                    Integer pageNumber,
                    List<OrderHint> orderHints,
                    List<String> propertyPaths)
Return a List of objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode

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)
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
orderHints - Supports path like orderHints.propertyNames which include *-to-one properties like createdBy.username or authorTeam.persistentTitleCache
Returns:
a list of instances of type T matching the queryString

listByReferenceTitle

List<T> listByReferenceTitle(Class<? extends T> clazz,
                             String queryString,
                             MatchMode matchmode,
                             List<org.hibernate.criterion.Criterion> criteria,
                             Integer pageSize,
                             Integer pageNumber,
                             List<OrderHint> orderHints,
                             List<String> propertyPaths)
Return a List of objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode

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)
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
orderHints - Supports path like orderHints.propertyNames which include *-to-one properties like createdBy.username or authorTeam.persistentTitleCache
Returns:
a list of instances of type T matching the queryString

search

Pager<T> search(Class<? extends T> clazz,
                String queryString,
                Integer pageSize,
                Integer pageNumber,
                List<OrderHint> orderHints,
                List<String> propertyPaths)
Returns a Paged List of IdentifiableEntity instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)

Parameters:
clazz - filter the results by class (or pass null to return all IdentifiableEntity instances)
queryString -
pageSize - The maximum number of identifiable entities returned (can be null for all matching identifiable entities)
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 be initialized
Returns:
a Pager IdentifiableEntity instances
See Also:
Apache Lucene - Query Parser Syntax

deduplicate

int deduplicate(Class<? extends T> clazz,
                IMatchStrategy matchStrategy,
                IMergeStrategy mergeStrategy)
This method tries to deduplicate all objects of a certain class by first trying to find matchabel objects and merging them in a second step. For performance reasons implementing classes must not guarantee that ALL matching object pairs are found but only a subset. But it must guarantee that only matching objects are merged.
Matching is defined by the given matching strategy or if no matching strategy is given the default matching strategy is used.
Clazz must implement IMatchable and IMergable otherwise no deduplication is performed.
The current implementation in IdentifiableServiceBase tries to match and merge all objects with an identical non empty titleCache.

Parameters:
clazz -
matchStrategy -
mergeStrategy -
Returns:
the number of merges performed during deduplication

findTitleCache

Pager<T> findTitleCache(Class<? extends T> clazz,
                        String queryString,
                        Integer pageSize,
                        Integer pageNumber,
                        List<OrderHint> orderHints,
                        MatchMode matchMode)
Return a Pager of objects with distinct titleCache strings filtered by the given query string, optionally filtered by class, optionally with a particular MatchMode

Parameters:
clazz -
queryString -
pageSize -
pageNumber -
orderHints -
matchMode -
Returns:


Copyright © 2007-2013 EDIT. All Rights Reserved.