Class QueryByExamplePredicateBuilder
java.lang.Object
org.springframework.data.jpa.convert.QueryByExamplePredicateBuilder
QueryByExamplePredicateBuilder
creates a single CriteriaBuilder.and(Predicate...)
combined
Predicate
for a given Example
. The builder includes any
SingularAttribute
of the Example.getProbe()
applying String
and
null matching strategies configured on the Example
. Ignored paths are no matter of their actual
value not considered. - Since:
- 1.10
- Author:
- Christoph Strobl, Mark Paluch, Oliver Gierke, Jens Schauder, Greg Turnquist
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> jakarta.persistence.criteria.Predicate
getPredicate
(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaBuilder cb, org.springframework.data.domain.Example<T> example) Extract thePredicate
representing theExample
.static <T> jakarta.persistence.criteria.Predicate
getPredicate
(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaBuilder cb, org.springframework.data.domain.Example<T> example, EscapeCharacter escapeCharacter) Extract thePredicate
representing theExample
.
-
Constructor Details
-
QueryByExamplePredicateBuilder
public QueryByExamplePredicateBuilder()
-
-
Method Details
-
getPredicate
@Nullable public static <T> jakarta.persistence.criteria.Predicate getPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaBuilder cb, org.springframework.data.domain.Example<T> example) Extract thePredicate
representing theExample
.- Parameters:
root
- must not be null.cb
- must not be null.example
- must not be null.- Returns:
- null indicates no
Predicate
.
-
getPredicate
@Nullable public static <T> jakarta.persistence.criteria.Predicate getPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaBuilder cb, org.springframework.data.domain.Example<T> example, EscapeCharacter escapeCharacter) Extract thePredicate
representing theExample
.- Parameters:
root
- must not be null.cb
- must not be null.example
- must not be null.escapeCharacter
- Must not be null.- Returns:
- null indicates no constraints
-