T - The entity root typepublic interface Specification<T>
Specification.| Modifier and Type | Method and Description |
|---|---|
default Specification<T> |
and(Specification<T> other)
ANDs the given
Specification to the current one. |
static <T> Specification<T> |
not(Specification<T> spec)
Negates the given
Specification. |
default Specification<T> |
or(Specification<T> other)
ORs the given specification to the current one.
|
javax.persistence.criteria.Predicate |
toPredicate(javax.persistence.criteria.Root<T> root,
javax.persistence.criteria.CriteriaQuery<?> query,
javax.persistence.criteria.CriteriaBuilder criteriaBuilder)
Creates a WHERE clause for a query of the referenced entity in form of a
Predicate for the given
Root and CriteriaQuery. |
static <T> Specification<T> |
where(Specification<T> spec)
Simple static factory method to add some syntactic sugar around a
Specification. |
@NonNull static <T> Specification<T> not(@Nullable Specification<T> spec)
Specification.T - the type of the Root the resulting Specification operates on.spec - can be null.@NonNull static <T> Specification<T> where(@Nullable Specification<T> spec)
Specification.T - the type of the Root the resulting Specification operates on.spec - can be null.@NonNull default Specification<T> and(@Nullable Specification<T> other)
Specification to the current one.other - can be null.@NonNull default Specification<T> or(@Nullable Specification<T> other)
other - can be null.@Nullable
javax.persistence.criteria.Predicate toPredicate(@NonNull
javax.persistence.criteria.Root<T> root,
@NonNull
javax.persistence.criteria.CriteriaQuery<?> query,
@NonNull
javax.persistence.criteria.CriteriaBuilder criteriaBuilder)
Predicate for the given
Root and CriteriaQuery.root - must not be null.query - must not be null.criteriaBuilder - must not be null.Predicate, may be null.