- Type Parameters:
T- entity type.V- entity attribute type.
- All Superinterfaces:
Restriction<T>
A Jakarta Data provider's view of a restriction on a single entity attribute or expression.
This class is used by the Jakarta Data provider to interpret a
restriction that is supplied by the application. The application should use
the instructions in the Restriction class and the
static metamodel to obtain a restriction.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionReturns the constraint that this restriction applies to the entity attribute or expression.Expression<T, V> Returns the entity attribute or expression to which this restriction applies.static <T,V> Restriction <T> of(Expression<T, V> expression, Constraint<V> constraint) Creates a new restriction that represents a constraint on the specified entity attribute or expression.Methods inherited from interface jakarta.data.restrict.Restriction
negate
-
Method Details
-
expression
Expression<T,V> expression()Returns the entity attribute or expression to which this restriction applies.
This method is intended for Jakarta Data providers.
- Returns:
- the entity attribute or expression.
-
constraint
Constraint<V> constraint()Returns the constraint that this restriction applies to the entity attribute or expression.
This method is intended for Jakarta Data providers.
- Returns:
- the constraint that is applied by this restriction.
-
of
Creates a new restriction that represents a constraint on the specified entity attribute or expression.
Restrictions on entity attributes can often be obtained from the static metamodel more conveniently than from this method.
- Type Parameters:
T- entity class.V- entity attribute class.- Parameters:
expression- the entity attribute or expression to which the restriction applies.constraint- the constraint that is applied by the restriction.- Returns:
- the restriction.
- Throws:
NullPointerException- if the expression or constraint isnull.
-