Package ubic.gemma.persistence.service
Class AbstractCriteriaFilteringVoEnabledDao<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractDao<O>
-
- ubic.gemma.persistence.service.AbstractVoEnabledDao<O,VO>
-
- ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao<O,VO>
-
- ubic.gemma.persistence.service.AbstractCriteriaFilteringVoEnabledDao<O,VO>
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,BaseDao<O>
,BaseVoEnabledDao<O,VO>
,FilteringDao<O>
,FilteringVoEnabledDao<O,VO>
- Direct Known Subclasses:
ExpressionAnalysisResultSetDaoImpl
,QuantitationTypeDaoImpl
public abstract class AbstractCriteriaFilteringVoEnabledDao<O extends Identifiable,VO extends IdentifiableValueObject<O>> extends AbstractFilteringVoEnabledDao<O,VO>
Partial implementation ofFilteringVoEnabledDao
based on the HibernateCriteria
API.- Author:
- poirigui
- See Also:
to obtain from a .
,for utilities to include ACL constraints on the VOs at the database-level.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao
AbstractFilteringVoEnabledDao.FilterablePropertiesConfigurer, AbstractFilteringVoEnabledDao.FilterablePropertyMeta
-
-
Field Summary
-
Fields inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDao
REPORT_SLOW_QUERY_AFTER_MS
-
Fields inherited from class ubic.gemma.persistence.service.AbstractDao
log
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCriteriaFilteringVoEnabledDao(Class<? extends O> elementClass, SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
long
count(Filters filters)
Count VOs matching the given filters.protected AbstractFilteringVoEnabledDao.FilterablePropertyMeta
getFilterablePropertyMeta(String propertyName)
protected Criteria
getFilteringCriteria(Filters filters)
Obtain aCriteria
for loading VOs.List<O>
load(Filters filters, Sort sort)
Load entities matching the given filters.Slice<O>
load(Filters filters, Sort sort, int offset, int limit)
Load a slice of entities matching the given filters.List<Long>
loadIds(Filters filters, Sort sort)
Load IDs of entities matching the given filters.List<VO>
loadValueObjects(Filters filters, Sort sort)
Load VOs with minimal ordering and filtering.Slice<VO>
loadValueObjects(Filters filters, Sort sort, int offset, int limit)
Load VOs with ordering, filtering and offset/limit.-
Methods inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao
configureFilterableProperties, getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyMeta, getFilterablePropertyType, getSort
-
Methods inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDao
doLoadValueObject, doLoadValueObjects, loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds, postProcessValueObjects
-
Methods inherited from class ubic.gemma.persistence.service.AbstractDao
countAll, create, create, find, findByProperty, findByPropertyIn, findOneByProperty, findOrCreate, getBatchSize, getElementClass, getIdentifierPropertyName, getSessionFactory, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, streamQuery, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.persistence.service.BaseDao
countAll, create, create, find, findOrCreate, getElementClass, getIdentifierPropertyName, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, update, update
-
Methods inherited from interface ubic.gemma.persistence.service.BaseVoEnabledDao
loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds
-
-
-
-
Constructor Detail
-
AbstractCriteriaFilteringVoEnabledDao
protected AbstractCriteriaFilteringVoEnabledDao(Class<? extends O> elementClass, SessionFactory sessionFactory)
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classAbstractFilteringVoEnabledDao<O extends Identifiable,VO extends IdentifiableValueObject<O>>
-
getFilteringCriteria
protected Criteria getFilteringCriteria(@Nullable Filters filters)
Obtain aCriteria
for loading VOs.
-
loadIds
public List<Long> loadIds(@Nullable Filters filters, @Nullable Sort sort)
Description copied from interface:FilteringDao
Load IDs of entities matching the given filters.
-
load
public List<O> load(@Nullable Filters filters, @Nullable Sort sort)
Description copied from interface:FilteringDao
Load entities matching the given filters.
-
load
public Slice<O> load(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit)
Description copied from interface:FilteringDao
Load a slice of entities matching the given filters.
-
loadValueObjects
public Slice<VO> loadValueObjects(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit)
Description copied from interface:FilteringVoEnabledDao
Load VOs with ordering, filtering and offset/limit.Consider using
FilteringDao.getFilter(String, Filter.Operator, String)
andFilteringDao.getSort(String, Sort.Direction, Sort.NullMode)
to produce the filters and sort safely from user input.- Parameters:
filters
- filters applied on the search. The properties mentioned in theFilter
must exist and be visible to Hibernate. You can use nested properties such as "curationDetails.lastUpdated".sort
- an object property and direction to order by. This property must exist and be visible to Hibernate. You can use nested properties such as "curationDetails.lastUpdated".offset
- an offset from which entities are retrieved when sorted according to the sort argument, or 0 to ignorelimit
- a limit on the number of returned results, or -1 to ignore- Returns:
- a slice of the relevant data
- See Also:
FilteringDao.load(Filters, Sort, int, int)
-
loadValueObjects
public List<VO> loadValueObjects(@Nullable Filters filters, @Nullable Sort sort)
Description copied from interface:FilteringVoEnabledDao
Load VOs with minimal ordering and filtering.Use this as an alternative to
FilteringVoEnabledDao.loadValueObjects(Filters, Sort, int, int)
if you do not intend to provide pagination capabilities.
-
count
public long count(@Nullable Filters filters)
Description copied from interface:FilteringDao
Count VOs matching the given filters.
-
getFilterablePropertyMeta
protected AbstractFilteringVoEnabledDao.FilterablePropertyMeta getFilterablePropertyMeta(String propertyName) throws IllegalArgumentException
Description copied from class:AbstractFilteringVoEnabledDao
Obtain various meta-information used to infer what to use in aFilter
orSort
.This is used by
AbstractFilteringVoEnabledDao.getFilter(String, Filter.Operator, String)
andFilteringDao.getSort(String, Sort.Direction, Sort.NullMode)
.- Overrides:
getFilterablePropertyMeta
in classAbstractFilteringVoEnabledDao<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- Throws:
IllegalArgumentException
- if no such propertyName exists inAbstractFilteringVoEnabledDao
- See Also:
AbstractFilteringVoEnabledDao.getFilter(String, Filter.Operator, String)
,AbstractFilteringVoEnabledDao.getFilter(String, Filter.Operator, Collection)
,FilteringDao.getSort(String, Sort.Direction, Sort.NullMode)
-
-