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, Arnaud Lecointre
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @Nullable jakarta.persistence.criteria.PredicategetPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaBuilder cb, Example<T> example) Extract thePredicaterepresenting theExample.static <T> @Nullable jakarta.persistence.criteria.PredicategetPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaBuilder cb, Example<T> example, EscapeCharacter escapeCharacter) Extract thePredicaterepresenting theExample.
-
Constructor Details
-
QueryByExamplePredicateBuilder
public QueryByExamplePredicateBuilder()
-
-
Method Details
-
getPredicate
public static <T> @Nullable jakarta.persistence.criteria.Predicate getPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaBuilder cb, Example<T> example) Extract thePredicaterepresenting theExample.- Parameters:
root- must not be null.cb- must not be null.example- must not be null.- Returns:
- null indicates no
Predicate.
-
getPredicate
public static <T> @Nullable jakarta.persistence.criteria.Predicate getPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaBuilder cb, Example<T> example, EscapeCharacter escapeCharacter) Extract thePredicaterepresenting 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
-