Interface PredicateSpecification<T>
- Type Parameters:
T
- The entity root type
public interface PredicateSpecification<T>
The predicate specification.
- Since:
- 3.2
- Author:
- Denis Stepanov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PredicateSpecification<?>
Include all specification. -
Method Summary
Modifier and TypeMethodDescriptiondefault PredicateSpecification<T>
and
(PredicateSpecification<T> other) ANDs the givenPredicateSpecification
to the current one.static <T> PredicateSpecification<T>
not
(PredicateSpecification<T> spec) Negates the givenPredicateSpecification
.default PredicateSpecification<T>
or
(PredicateSpecification<T> other) ORs the givenPredicateSpecification
to the current one.jakarta.persistence.criteria.Predicate
toPredicate
(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) Creates a WHERE clause predicate for the given entityRoot
.static <T> PredicateSpecification<T>
where
(PredicateSpecification<T> spec) Simple static factory method to add some syntactic sugar around aPredicateSpecification
.
-
Field Details
-
ALL
Include all specification.
-
-
Method Details
-
where
Simple static factory method to add some syntactic sugar around aPredicateSpecification
.- Type Parameters:
T
- the type of theRoot
the resulting Specification operates on.- Parameters:
spec
- The specification.- Returns:
- predicate specification.
-
not
Negates the givenPredicateSpecification
.- Type Parameters:
T
- the type of theRoot
the resulting Specification operates on.- Parameters:
spec
- The specification.- Returns:
- negated specification}.
-
and
ANDs the givenPredicateSpecification
to the current one.- Parameters:
other
- The other predicate.- Returns:
- The conjunction of the specifications
-
or
ORs the givenPredicateSpecification
to the current one.- Parameters:
other
- The other predicate.- Returns:
- The disjunction of the specifications
-
toPredicate
@Nullable jakarta.persistence.criteria.Predicate toPredicate(@NonNull jakarta.persistence.criteria.Root<T> root, @NonNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) Creates a WHERE clause predicate for the given entityRoot
.- Parameters:
root
- The entity root.criteriaBuilder
- The criteria builder.- Returns:
- a
Predicate
-