Class AbstractNoopFilteringVoEnabledDao<O extends Identifiable,VO extends IdentifiableValueObject<O>>
- All Implemented Interfaces:
BaseDao<O>
,BaseVoEnabledDao<O,
,VO> FilteringDao<O>
,FilteringVoEnabledDao<O,
VO>
- Direct Known Subclasses:
BioAssayDaoImpl
,CharacteristicDaoImpl
,DatabaseEntryDaoImpl
,FactorValueDaoImpl
This is necessary because AbstractFilteringVoEnabledDao
reroutes VO loading methods from BaseVoEnabledDao
through the Filter
-based mechanism for consistency, so it is not a suitable base class if you don't want or
need to implement the filtering aspect of the interface.
-
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
ConstructorsModifierConstructorDescriptionprotected
AbstractNoopFilteringVoEnabledDao
(Class<? extends O> elementClass, SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionfinal long
Count VOs matching the given filters.final <T> Filter
getFilter
(String property, Class<T> propertyType, Filter.Operator operator, Collection<T> values) Obtain aFilter
with an already parsed collection of values.final <T> Filter
getFilter
(String property, Class<T> propertyType, Filter.Operator operator, T value) Obtain aFilter
with an already parsed value.final Filter
getFilter
(String property, Filter.Operator operator, String value) Obtain anFilter
for the entity this DAO is providing.getFilter
(String property, Filter.Operator operator, String value, SubqueryMode subqueryMode) final Filter
getFilter
(String property, Filter.Operator operator, Collection<String> values) Similar toFilteringDao.getFilter(String, Filter.Operator, String)
, but with a collection of values.getFilter
(String property, Filter.Operator operator, Collection<String> values, SubqueryMode subqueryMode) List all properties availble for filtering.getFilterablePropertyAllowedValues
(String property) Obtain a short list of allowed values for the given property, or null if unrestricted.final String
getFilterablePropertyDescription
(String propertyName) Obtain a short description for a given filterable property.boolean
getFilterablePropertyIsUsingSubquery
(String property) Indicate if the given property is using a subquery for filtering.final Class
<?> getFilterablePropertyType
(String propertyName) Obtain the type of the given filterable property.final Sort
getSort
(String property, Sort.Direction direction, Sort.NullMode nullMode) Obtain aSort
object for a property of theFilteringDao
.Load entities matching the given filters.Load a slice of entities matching the given filters.Load IDs of entities matching the given filters.loadValueObjects
(Filters filters, Sort sort) Load VOs with minimal ordering and filtering.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.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 Details
-
AbstractNoopFilteringVoEnabledDao
protected AbstractNoopFilteringVoEnabledDao(Class<? extends O> elementClass, SessionFactory sessionFactory)
-
-
Method Details
-
getFilterableProperties
Description copied from interface:FilteringDao
List all properties availble for filtering.- Specified by:
getFilterableProperties
in interfaceFilteringDao<O extends Identifiable>
-
getFilterablePropertyType
public final Class<?> getFilterablePropertyType(String propertyName) throws IllegalArgumentException Description copied from interface:FilteringDao
Obtain the type of the given filterable property.- Specified by:
getFilterablePropertyType
in interfaceFilteringDao<O extends Identifiable>
- Throws:
IllegalArgumentException
- if no such property exists, the cause will be aNoSuchFieldException
-
getFilterablePropertyDescription
@Nullable public final String getFilterablePropertyDescription(String propertyName) throws IllegalArgumentException Description copied from interface:FilteringDao
Obtain a short description for a given filterable property.- Specified by:
getFilterablePropertyDescription
in interfaceFilteringDao<O extends Identifiable>
- Throws:
IllegalArgumentException
- if no such property exists
-
getFilterablePropertyAllowedValues
Description copied from interface:FilteringDao
Obtain a short list of allowed values for the given property, or null if unrestricted.The returned values must be of the type outlined by
FilteringDao.getFilterablePropertyType(String)
, generally a list ofString
orInteger
to denote possible values for an enumerated type.- Specified by:
getFilterablePropertyAllowedValues
in interfaceFilteringDao<O extends Identifiable>
-
getFilterablePropertyIsUsingSubquery
Description copied from interface:FilteringDao
Indicate if the given property is using a subquery for filtering.When this is the case, the filter will only check if at least one related entity is matching.
- Specified by:
getFilterablePropertyIsUsingSubquery
in interfaceFilteringDao<O extends Identifiable>
-
getFilter
public final Filter getFilter(String property, Filter.Operator operator, String value) throws IllegalArgumentException Description copied from interface:FilteringDao
Obtain anFilter
for the entity this DAO is providing.It is the responsibility of the DAO to infer the filter property type as well as the alias to use.
If the filter refers to a related entity (i.e. a
BioAssay
of anExpressionExperiment
), then the DAO should inject the corresponding DAO and delegate it the work of creating the filter.In the frontend, that correspond to a FilterArg, but since the definition is not available here, we unpack its attributes.
- Specified by:
getFilter
in interfaceFilteringDao<O extends Identifiable>
- Parameters:
property
- property name in the entity use as a left-hand side of the operatoroperator
- an operatorvalue
- the corresponding, unparsed value, to the right-hand side of the operator- Returns:
- a filter filled with the object alias, property, inferred type, operator and parsed value
- Throws:
IllegalArgumentException
- if the property does not exist inFilteringDao
, or if the operator cannot be applied, or if the value cannot apply to the property an operator seeFilter.parse(String, String, Class, Filter.Operator, String, String)
for more details
-
getFilter
public Filter getFilter(String property, Filter.Operator operator, String value, SubqueryMode subqueryMode) - Specified by:
getFilter
in interfaceFilteringDao<O extends Identifiable>
-
getFilter
public final Filter getFilter(String property, Filter.Operator operator, Collection<String> values) throws IllegalArgumentException Description copied from interface:FilteringDao
Similar toFilteringDao.getFilter(String, Filter.Operator, String)
, but with a collection of values.- Specified by:
getFilter
in interfaceFilteringDao<O extends Identifiable>
- Throws:
IllegalArgumentException
-
getFilter
public Filter getFilter(String property, Filter.Operator operator, Collection<String> values, SubqueryMode subqueryMode) - Specified by:
getFilter
in interfaceFilteringDao<O extends Identifiable>
-
getFilter
public final <T> Filter getFilter(String property, Class<T> propertyType, Filter.Operator operator, T value) Description copied from interface:FilteringDao
Obtain aFilter
with an already parsed value.- Specified by:
getFilter
in interfaceFilteringDao<O extends Identifiable>
- See Also:
-
getFilter
public final <T> Filter getFilter(String property, Class<T> propertyType, Filter.Operator operator, Collection<T> values) Description copied from interface:FilteringDao
Obtain aFilter
with an already parsed collection of values.- Specified by:
getFilter
in interfaceFilteringDao<O extends Identifiable>
- See Also:
-
getSort
public final Sort getSort(String property, @Nullable Sort.Direction direction, Sort.NullMode nullMode) throws IllegalArgumentException Description copied from interface:FilteringDao
Obtain aSort
object for a property of theFilteringDao
.- Specified by:
getSort
in interfaceFilteringDao<O extends Identifiable>
- Parameters:
property
- a property ofFilteringDao
to sort bydirection
- a sorting direction, or null if the default direction appliesnullMode
- behavior for null values when sorting- Returns:
- a
Sort
object that can be used, for example, onFilteringVoEnabledDao.loadValueObjects(Filters, Sort, int, int)
- Throws:
IllegalArgumentException
- if no such field exists inFilteringDao
-
loadIds
Description copied from interface:FilteringDao
Load IDs of entities matching the given filters.- Specified by:
loadIds
in interfaceFilteringDao<O extends Identifiable>
-
load
Description copied from interface:FilteringDao
Load entities matching the given filters.- Specified by:
load
in interfaceFilteringDao<O extends Identifiable>
-
load
Description copied from interface:FilteringDao
Load a slice of entities matching the given filters.- Specified by:
load
in interfaceFilteringDao<O extends Identifiable>
-
count
Description copied from interface:FilteringDao
Count VOs matching the given filters.- Specified by:
count
in interfaceFilteringDao<O extends Identifiable>
-
loadValueObjects
public final 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.- Specified by:
loadValueObjects
in interfaceFilteringVoEnabledDao<O extends Identifiable,
VO extends IdentifiableValueObject<O>> - 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:
-
loadValueObjects
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.- Specified by:
loadValueObjects
in interfaceFilteringVoEnabledDao<O extends Identifiable,
VO extends IdentifiableValueObject<O>> - See Also:
-