public interface Specification<T> extends Serializable
| Modifier and Type | Field and Description |
|---|---|
static long |
serialVersionUID |
| 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. |
static final long serialVersionUID
static <T> Specification<T> not(Specification<T> spec)
Specification.T - spec - can be null.static <T> Specification<T> where(Specification<T> spec)
Specification.T - spec - can be null.default Specification<T> and(Specification<T> other)
Specification to the current one.other - can be null.default Specification<T> or(Specification<T> other)
other - can be null.@Nullable javax.persistence.criteria.Predicate toPredicate(javax.persistence.criteria.Root<T> root, javax.persistence.criteria.CriteriaQuery<?> query, 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.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.