Package ubic.gemma.persistence.service
Class AbstractFilteringVoEnabledDao.FilterablePropertiesConfigurer
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao.FilterablePropertiesConfigurer
-
- Enclosing class:
- AbstractFilteringVoEnabledDao<O extends Identifiable,VO extends IdentifiableValueObject<O>>
protected class AbstractFilteringVoEnabledDao.FilterablePropertiesConfigurer extends Object
Configurer for filterable properties and their aliases.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FilterablePropertiesConfigurer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
registerAlias(String prefix, String objectAlias, Class<?> propertyType, String aliasFor, int maxDepth)
void
registerAlias(String prefix, String objectAlias, Class<?> propertyType, String aliasFor, int maxDepth, boolean useSubquery)
Register an alias for a property.void
registerEntity(String prefix, Class<?> entityClass, int maxDepth)
void
registerEntity(String prefix, Class<?> entityClass, int maxDepth, boolean useSubquery)
Register an entity available at a given prefix.void
registerProperties(String... propertyNames)
Register all the given properties.void
registerProperty(String propertyName)
void
registerProperty(String propertyName, boolean useSubquery)
Register a given property.void
unregisterEntity(String prefix, Class<?> entityClass)
Unregister an entity at a given prefix previously registered viaregisterEntity(String, Class, int)
.void
unregisterProperties(Predicate<? super String> predicate)
Unregister all the properties matching the given predicate.void
unregisterProperty(String propertyName)
-
-
-
Method Detail
-
registerProperty
public void registerProperty(String propertyName)
-
registerProperty
public void registerProperty(String propertyName, boolean useSubquery)
Register a given property.- Throws:
IllegalArgumentException
- if the property is already registered
-
registerProperties
public void registerProperties(String... propertyNames) throws IllegalArgumentException
Register all the given properties.- Throws:
IllegalArgumentException
- if any of the given properties is already registered
-
unregisterProperty
public void unregisterProperty(String propertyName)
- Throws:
IllegalArgumentException
- if no properties match the given name
-
unregisterProperties
public void unregisterProperties(Predicate<? super String> predicate) throws IllegalArgumentException
Unregister all the properties matching the given predicate.- Throws:
IllegalArgumentException
- if no properties match the given predicate
-
registerEntity
public void registerEntity(String prefix, Class<?> entityClass, int maxDepth) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
registerEntity
public void registerEntity(String prefix, Class<?> entityClass, int maxDepth, boolean useSubquery) throws IllegalArgumentException
Register an entity available at a given prefix.This method recursively register the properties of a given entity up to the maximum depth.
- Parameters:
prefix
- a prefix under which the entity is made availableentityClass
- a class for the entity, which must be registered mapped by HibernatemaxDepth
- maximum depth for visiting properties. For example, zero would expose no property but the entity itself, 1 would expose the properties of the alias, 2 would expose the properties of any entity directly related to the given entity, etc.useSubquery
- whether to use a subquery when filtering by this entity (and its descendant)- Throws:
IllegalArgumentException
- if no entity of the given type is registered under the given prefix or if the prefix is invalid
-
unregisterEntity
public void unregisterEntity(String prefix, Class<?> entityClass)
Unregister an entity at a given prefix previously registered viaregisterEntity(String, Class, int)
.Note that since
registerEntity(String, Class, int)
works recursively, you can unregister an entity registered under a longer prefix. For example, if you registered anAnalysis
underanalysis.
, you can then unregister anExpressionExperiment
underanalysis.experimentAnalyzed
.- Throws:
IllegalArgumentException
- if no entity of the given type is registered under the given prefix or if the prefix is invalid
-
registerAlias
public void registerAlias(String prefix, @Nullable String objectAlias, Class<?> propertyType, @Nullable String aliasFor, int maxDepth)
-
registerAlias
public void registerAlias(String prefix, @Nullable String objectAlias, Class<?> propertyType, @Nullable String aliasFor, int maxDepth, boolean useSubquery)
Register an alias for a property.This also registers a property under the given prefix as per
registerEntity(String, Class, int)
.- Parameters:
objectAlias
- internal alias used to refer to the entity as perPropertyMapping.getObjectAlias()
.- See Also:
registerEntity(String, Class, int)
-
-