Package org.hibernate.internal
Class FilterImpl
java.lang.Object
org.hibernate.internal.FilterImpl
- All Implemented Interfaces:
Serializable,Filter
Implementation of FilterImpl. FilterImpl implements the user's
view into enabled dynamic filters, allowing them to set filter parameter values.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the associateddefinitionof this named filter.getName()Get the name of this filter.getParameter(String name) Get the value of the named parameter for the current filter.Supplier<?> getParameterResolver(String name) getParameterValue(String paramName) Obtain the argument currently bound to the filter parameter with the given name.booleanGet a flag that defines if the filter should be applied on direct fetches or not.booleanGet a flag that defines if the filter should be enabled by default.setParameter(String name, Object value) Set the named parameter's value for this filter.setParameterList(String name, Object[] values) Set the named parameter's value list for this filter.setParameterList(String name, Collection<?> values) Set the named parameter's value list for this filter.voidvalidate()Perform validation of the filter state.
-
Field Details
-
MARKER
- See Also:
-
-
Constructor Details
-
FilterImpl
Constructs a new FilterImpl.- Parameters:
configuration- The filter's global configuration.
-
-
Method Details
-
getFilterDefinition
Description copied from interface:FilterGet the associateddefinitionof this named filter.- Specified by:
getFilterDefinitionin interfaceFilter- Returns:
- The filter definition
-
getName
Get the name of this filter. -
isAutoEnabled
public boolean isAutoEnabled()Get a flag that defines if the filter should be enabled by default.- Specified by:
isAutoEnabledin interfaceFilter- Returns:
- The flag value.
-
isAppliedToLoadByKey
public boolean isAppliedToLoadByKey()Get a flag that defines if the filter should be applied on direct fetches or not.- Specified by:
isAppliedToLoadByKeyin interfaceFilter- Returns:
- The flag value.
-
getParameters
-
setParameter
Set the named parameter's value for this filter.- Specified by:
setParameterin interfaceFilter- Parameters:
name- The parameter's name.value- The value to be applied.- Returns:
- This FilterImpl instance (for method chaining).
- Throws:
IllegalArgumentException- Indicates that either the parameter was undefined or that the type of the passed value did not match the configured type.
-
setParameterList
Set the named parameter's value list for this filter. Used in conjunction with IN-style filter criteria.- Specified by:
setParameterListin interfaceFilter- Parameters:
name- The parameter's name.values- The values to be expanded into an SQL IN list.- Returns:
- This FilterImpl instance (for method chaining).
- Throws:
HibernateException
-
setParameterList
Set the named parameter's value list for this filter. Used in conjunction with IN-style filter criteria.- Specified by:
setParameterListin interfaceFilter- Parameters:
name- The parameter's name.values- The values to be expanded into an SQL IN list.- Returns:
- This FilterImpl instance (for method chaining).
- Throws:
IllegalArgumentException
-
getParameter
Get the value of the named parameter for the current filter.- Parameters:
name- The name of the parameter for which to return the value.- Returns:
- The value of the named parameter.
-
getParameterResolver
-
validate
Perform validation of the filter state. This is used to verify the state of the filter after its enablement and before its use.- Specified by:
validatein interfaceFilter- Throws:
HibernateException- If the state is not currently valid.
-
getParameterValue
Description copied from interface:FilterObtain the argument currently bound to the filter parameter with the given name.- Specified by:
getParameterValuein interfaceFilter- Parameters:
paramName- the name of the filter parameter- Returns:
- the value currently set
-