|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase
eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase<T>
eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase<T>
eu.etaxonomy.cdm.persistence.dao.hibernate.common.AnnotatableDaoImpl<T>
eu.etaxonomy.cdm.persistence.dao.hibernate.common.IdentifiableDaoBase<T>
public class IdentifiableDaoBase<T extends IdentifiableEntity>
| Field Summary | |
|---|---|
protected String |
defaultField
|
protected Class<? extends T>[] |
indexedClasses
|
| Fields inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase |
|---|
defaultBeanInitializer, flushAfterNo, type, version |
| Constructor Summary | |
|---|---|
IdentifiableDaoBase(Class<T> type)
|
|
| Method Summary | ||
|---|---|---|
int |
count(Class<? extends T> clazz,
String queryString)
Returns a count of T instances where entities match a given queryString (as interpreted by the Lucene QueryParser) |
|
int |
countByReferenceTitle(Class<? extends T> clazz,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion)
Return a count of objects matching the given query string in the title, optionally filtered by class, optionally with a particular MatchMode |
|
int |
countByTitle(Class<? extends T> clazz,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion)
Return a count of objects matching the given query string in the titleCache, optionally filtered by class, optionally with a particular MatchMode |
|
Integer |
countByTitle(String queryString)
|
|
Integer |
countByTitle(String queryString,
CdmBase sessionObject)
|
|
Integer |
countByTitle(String queryString,
MatchMode matchMode,
List<org.hibernate.criterion.Criterion> criteria)
|
|
int |
countRights(T identifiableEntity)
Return a count of the rights for this identifiable entity |
|
int |
countSources(T identifiableEntity)
Return a count of the sources for this identifiable entity |
|
Long |
countTitleCache(Class<? extends T> clazz,
String queryString,
MatchMode matchMode)
Return a count of distinct titleCache Strings for a given IdentifiableEntity, optionally filtered by class, optionally with a particular MatchMode |
|
T |
find(LSID lsid)
Return an object by LSID. |
|
List<T> |
findByReferenceTitle(Class<? extends T> clazz,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion,
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> |
findByTitle(Class<? extends T> clazz,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion,
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> |
findByTitle(String queryString)
|
|
List<T> |
findByTitle(String queryString,
CdmBase sessionObject)
|
|
List<T> |
findByTitle(String queryString,
MatchMode matchmode,
int page,
int pagesize,
List<org.hibernate.criterion.Criterion> criteria)
|
|
List<T> |
findByTitleAndClass(String queryString,
Class<T> clazz)
|
|
List<T> |
findOriginalSourceByIdInSource(String idInSource,
String idNamespace)
|
|
List<T> |
findTitleCache(Class<? extends T> clazz,
String queryString,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
MatchMode matchMode)
TODO |
|
List<Credit> |
getCredits(T identifiableEntity,
Integer pageSize,
Integer pageNumber)
|
|
List<Rights> |
getRights(T identifiableEntity,
Integer pageSize,
Integer pageNumber,
List<String> propertyPaths)
Return a List of the rights for this identifiable entity |
|
List<IdentifiableSource> |
getSources(T identifiableEntity,
Integer pageSize,
Integer pageNumber,
List<String> propertyPaths)
Return a List of the sources for this identifiable entity |
|
List<UuidAndTitleCache<T>> |
getUuidAndTitleCache()
Return a list of all uuids mapped to titleCache in the convenient UuidAndTitleCache object. |
|
protected
|
getUuidAndTitleCache(org.hibernate.Query query)
|
|
void |
optimizeIndex()
Calls optimize on the relevant index (useful periodically to increase response times on the free-text search) |
|
void |
purgeIndex()
Removes all entities of type T from the index |
|
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) |
|
List<T> |
search(Class<? extends T> clazz,
String queryString,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
Returns a List of T instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser) |
|
String |
suggestQuery(String string)
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. |
|
| 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, delete, 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.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 |
| Field Detail |
|---|
protected String defaultField
protected Class<? extends T extends IdentifiableEntity>[] indexedClasses
| Constructor Detail |
|---|
public IdentifiableDaoBase(Class<T> type)
| Method Detail |
|---|
public List<T> findByTitle(String queryString)
findByTitle in interface ITitledDao<T extends IdentifiableEntity>
public List<T> findByTitle(String queryString,
CdmBase sessionObject)
findByTitle in interface ITitledDao<T extends IdentifiableEntity>
public List<T> findByTitleAndClass(String queryString,
Class<T> clazz)
findByTitleAndClass in interface ITitledDao<T extends IdentifiableEntity>
public List<T> findTitleCache(Class<? extends T> clazz,
String queryString,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
MatchMode matchMode)
IIdentifiableDao
findTitleCache in interface IIdentifiableDao<T extends IdentifiableEntity>
public Long countTitleCache(Class<? extends T> clazz,
String queryString,
MatchMode matchMode)
IIdentifiableDaoIdentifiableEntity, optionally filtered by class, optionally with a particular MatchMode
countTitleCache in interface IIdentifiableDao<T extends IdentifiableEntity>clazz - filter by class - can be null to include all instances of type TqueryString - the query string to filter by
public List<T> findByTitle(Class<? extends T> clazz,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
IIdentifiableDao
findByTitle in interface IIdentifiableDao<T extends IdentifiableEntity>clazz - filter by class - can be null to include all instances of type TqueryString - the query string to filter bymatchmode - use a particular type of matching (can be null - defaults to exact matching)criterion - extra restrictions to applypageSize - 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)orderHints - Supports path like orderHints.propertyNames which
include *-to-one properties like createdBy.username or
authorTeam.persistentTitleCachepropertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
public List<T> findByReferenceTitle(Class<? extends T> clazz,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
IIdentifiableDao
findByReferenceTitle in interface IIdentifiableDao<T extends IdentifiableEntity>clazz - filter by class - can be null to include all instances of type TqueryString - the query string to filter bymatchmode - use a particular type of matching (can be null - defaults to exact matching)criterion - extra restrictions to applypageSize - 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)orderHints - Supports path like orderHints.propertyNames which
include *-to-one properties like createdBy.username or
authorTeam.persistentTitleCachepropertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
public List<T> findByTitle(String queryString,
MatchMode matchmode,
int page,
int pagesize,
List<org.hibernate.criterion.Criterion> criteria)
findByTitle in interface ITitledDao<T extends IdentifiableEntity>criteria - TODO
public int countRights(T identifiableEntity)
IIdentifiableDao
countRights in interface IIdentifiableDao<T extends IdentifiableEntity>identifiableEntity - The identifiable entity
public int countSources(T identifiableEntity)
IIdentifiableDao
countSources in interface IIdentifiableDao<T extends IdentifiableEntity>identifiableEntity - The identifiable entity
public List<Rights> getRights(T identifiableEntity,
Integer pageSize,
Integer pageNumber,
List<String> propertyPaths)
IIdentifiableDao
getRights in interface IIdentifiableDao<T extends IdentifiableEntity>identifiableEntity - The identifiable entitypageSize - 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)
public List<Credit> getCredits(T identifiableEntity,
Integer pageSize,
Integer pageNumber)
public List<IdentifiableSource> getSources(T identifiableEntity,
Integer pageSize,
Integer pageNumber,
List<String> propertyPaths)
IIdentifiableDao
getSources in interface IIdentifiableDao<T extends IdentifiableEntity>identifiableEntity - The identifiable entitypageSize - 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)
public List<T> findOriginalSourceByIdInSource(String idInSource,
String idNamespace)
findOriginalSourceByIdInSource in interface IIdentifiableDao<T extends IdentifiableEntity>public T find(LSID lsid)
IIdentifiableDao
find in interface IIdentifiableDao<T extends IdentifiableEntity>lsid - a LifeScience Identifier identifying the desired objectpublic List<UuidAndTitleCache<T>> getUuidAndTitleCache()
IIdentifiableDaoUuidAndTitleCache 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.
getUuidAndTitleCache in interface IIdentifiableDao<T extends IdentifiableEntity>UuidAndTitleCache instancesprotected <E extends IIdentifiableEntity> List<UuidAndTitleCache<E>> getUuidAndTitleCache(org.hibernate.Query query)
public int countByTitle(Class<? extends T> clazz,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion)
IIdentifiableDao
countByTitle in interface IIdentifiableDao<T extends IdentifiableEntity>clazz - filter by class - can be null to include all instances of type TqueryString - the query string to filter bymatchmode - use a particular type of matching (can be null - defaults to exact matching)criterion - extra restrictions to apply
public int countByReferenceTitle(Class<? extends T> clazz,
String queryString,
MatchMode matchmode,
List<org.hibernate.criterion.Criterion> criterion)
IIdentifiableDao
countByReferenceTitle in interface IIdentifiableDao<T extends IdentifiableEntity>clazz - filter by class - can be null to include all instances of type TqueryString - the query string to filter bymatchmode - use a particular type of matching (can be null - defaults to exact matching)criterion - extra restrictions to apply
public int count(Class<? extends T> clazz,
String queryString)
ISearchableDao
count in interface ISearchableDao<T extends IdentifiableEntity>clazz - filter the results by class (or pass null to count all entities of type T)
public void optimizeIndex()
ISearchableDao
optimizeIndex in interface ISearchableDao<T extends IdentifiableEntity>public void purgeIndex()
ISearchableDao
purgeIndex in interface ISearchableDao<T extends IdentifiableEntity>public void rebuildIndex()
ISearchableDao
rebuildIndex in interface ISearchableDao<T extends IdentifiableEntity>
public List<T> search(Class<? extends T> clazz,
String queryString,
Integer pageSize,
Integer pageNumber,
List<OrderHint> orderHints,
List<String> propertyPaths)
ISearchableDao
search in interface ISearchableDao<T extends IdentifiableEntity>clazz - filter the results by class (or pass null to return all entities of type T)pageSize - The maximum number of entities returned (can be null for all matching 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.persistentTitleCachepropertyPaths - properties to be initialized
public String suggestQuery(String string)
ISearchableDao
suggestQuery in interface ISearchableDao<T extends IdentifiableEntity>string - Query string to check
public Integer countByTitle(String queryString)
countByTitle in interface ITitledDao<T extends IdentifiableEntity>
public Integer countByTitle(String queryString,
CdmBase sessionObject)
countByTitle in interface ITitledDao<T extends IdentifiableEntity>
public Integer countByTitle(String queryString,
MatchMode matchMode,
List<org.hibernate.criterion.Criterion> criteria)
countByTitle in interface ITitledDao<T extends IdentifiableEntity>criteria - TODO
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||