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_MSFields inherited from class ubic.gemma.persistence.service.AbstractDao
log -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractNoopFilteringVoEnabledDao(Class<? extends O> elementClass, SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionfinal longCount VOs matching the given filters.final <T> FiltergetFilter(String property, Class<T> propertyType, Filter.Operator operator, Collection<T> values) Obtain aFilterwith an already parsed collection of values.final <T> FiltergetFilter(String property, Class<T> propertyType, Filter.Operator operator, T value) Obtain aFilterwith an already parsed value.final FiltergetFilter(String property, Filter.Operator operator, String value) Obtain anFilterfor the entity this DAO is providing.getFilter(String property, Filter.Operator operator, String value, SubqueryMode subqueryMode) final FiltergetFilter(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 StringgetFilterablePropertyDescription(String propertyName) Obtain a short description for a given filterable property.final Class<?> getFilterablePropertyType(String propertyName) Obtain the type of the given filterable property.final SortgetSort(String property, Sort.Direction direction, Sort.NullMode nullMode) Obtain aSortobject for a property of theFilteringDao.booleanisFilterablePropertyDeprecated(String property) Indicate if the given property is deprecated.booleanisFilterablePropertyUsingSubquery(String property) Indicate if the given property is using a subquery for filtering.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, postProcessValueObjectsMethods inherited from class ubic.gemma.persistence.service.AbstractDao
countAll, create, create, find, findByProperty, findByPropertyIn, findOneByProperty, findOrCreate, getBatchSize, getElementClass, getEntityName, getIdentifierPropertyName, getSessionFactory, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, streamQuery, update, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ubic.gemma.persistence.service.BaseDao
countAll, create, create, find, findOrCreate, getElementClass, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, update, updateMethods 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:FilteringDaoList all properties availble for filtering.- Specified by:
getFilterablePropertiesin interfaceFilteringDao<O extends Identifiable>
-
getFilterablePropertyType
public final Class<?> getFilterablePropertyType(String propertyName) throws IllegalArgumentException Description copied from interface:FilteringDaoObtain the type of the given filterable property.- Specified by:
getFilterablePropertyTypein 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:FilteringDaoObtain a short description for a given filterable property.- Specified by:
getFilterablePropertyDescriptionin interfaceFilteringDao<O extends Identifiable>- Throws:
IllegalArgumentException- if no such property exists
-
getFilterablePropertyAllowedValues
Description copied from interface:FilteringDaoObtain 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 ofStringorIntegerto denote possible values for an enumerated type.- Specified by:
getFilterablePropertyAllowedValuesin interfaceFilteringDao<O extends Identifiable>
-
isFilterablePropertyUsingSubquery
Description copied from interface:FilteringDaoIndicate if the given property is using a subquery for filtering.- Specified by:
isFilterablePropertyUsingSubqueryin interfaceFilteringDao<O extends Identifiable>
-
isFilterablePropertyDeprecated
Description copied from interface:FilteringDaoIndicate if the given property is deprecated.- Specified by:
isFilterablePropertyDeprecatedin interfaceFilteringDao<O extends Identifiable>- Throws:
IllegalArgumentException- if the property does not exist
-
getFilter
public final Filter getFilter(String property, Filter.Operator operator, String value) throws IllegalArgumentException Description copied from interface:FilteringDaoObtain anFilterfor 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
BioAssayof 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:
getFilterin 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:
getFilterin interfaceFilteringDao<O extends Identifiable>
-
getFilter
public final Filter getFilter(String property, Filter.Operator operator, Collection<String> values) throws IllegalArgumentException Description copied from interface:FilteringDaoSimilar toFilteringDao.getFilter(String, Filter.Operator, String), but with a collection of values.- Specified by:
getFilterin interfaceFilteringDao<O extends Identifiable>- Throws:
IllegalArgumentException
-
getFilter
public Filter getFilter(String property, Filter.Operator operator, Collection<String> values, SubqueryMode subqueryMode) - Specified by:
getFilterin interfaceFilteringDao<O extends Identifiable>
-
getFilter
public final <T> Filter getFilter(String property, Class<T> propertyType, Filter.Operator operator, T value) Description copied from interface:FilteringDaoObtain aFilterwith an already parsed value.- Specified by:
getFilterin 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:FilteringDaoObtain aFilterwith an already parsed collection of values.- Specified by:
getFilterin 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:FilteringDaoObtain aSortobject for a property of theFilteringDao.- Specified by:
getSortin interfaceFilteringDao<O extends Identifiable>- Parameters:
property- a property ofFilteringDaoto sort bydirection- a sorting direction, or null if the default direction appliesnullMode- behavior for null values when sorting- Returns:
- a
Sortobject 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:FilteringDaoLoad IDs of entities matching the given filters.- Specified by:
loadIdsin interfaceFilteringDao<O extends Identifiable>
-
load
Description copied from interface:FilteringDaoLoad entities matching the given filters.- Specified by:
loadin interfaceFilteringDao<O extends Identifiable>
-
load
Description copied from interface:FilteringDaoLoad a slice of entities matching the given filters.- Specified by:
loadin interfaceFilteringDao<O extends Identifiable>
-
count
Description copied from interface:FilteringDaoCount VOs matching the given filters.- Specified by:
countin interfaceFilteringDao<O extends Identifiable>
-
loadValueObjects
public final Slice<VO> loadValueObjects(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit) Description copied from interface:FilteringVoEnabledDaoLoad 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:
loadValueObjectsin interfaceFilteringVoEnabledDao<O extends Identifiable,VO extends IdentifiableValueObject<O>> - Parameters:
filters- filters applied on the search. The properties mentioned in theFiltermust 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:FilteringVoEnabledDaoLoad 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:
loadValueObjectsin interfaceFilteringVoEnabledDao<O extends Identifiable,VO extends IdentifiableValueObject<O>> - See Also:
-