Package org.hibernate.annotations
Annotation Type FilterDef
-
@Target({TYPE,PACKAGE}) @Retention(RUNTIME) @Repeatable(FilterDefs.class) public @interface FilterDef
Declares a filter, specifying its name(), optionally, a default condition, and its parameter names and types, if it has parameters.Every entity or collection which is affected by a named filter declared using this annotation must be explicitly annotated
@Filter
, and the name of this filter definition must be given. The@Filter
annotation may override the default condition specified by this annotation usingFilter.condition()
.For example, if a filter is declared as follows:
{@code
- See Also:
Filter
,DialectOverride.FilterDefs
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String
defaultCondition
The default filter condition, a SQL expression used for filtering the rows returned by a query when the filter is enabled.ParamDef[]
parameters
The names and types of the parameters of the filter.
-
-
-
Element Detail
-
name
String name
The name of the declared filter.
-
-
-
defaultCondition
String defaultCondition
The default filter condition, a SQL expression used for filtering the rows returned by a query when the filter is enabled. This default condition may be overridden by any entity or collection to which the filter applies usingFilter.condition()
.If every entity and collection to which the filter applies explicitly specifies its own filter condition, then the default condition is unnecessary, and so this member is optional.
- Default:
- ""
-
-
-
parameters
ParamDef[] parameters
The names and types of the parameters of the filter.- Default:
- {}
-
-