Class JpaCountQueryCreator
java.lang.Object
org.springframework.data.repository.query.parser.AbstractQueryCreator<jakarta.persistence.criteria.CriteriaQuery<? extends Object>,jakarta.persistence.criteria.Predicate>
org.springframework.data.jpa.repository.query.JpaQueryCreator
org.springframework.data.jpa.repository.query.JpaCountQueryCreator
Special
JpaQueryCreator
that creates a count projecting query.- Author:
- Oliver Gierke, Marc Lefrançois, Mark Paluch, Greg Turnquist
-
Constructor Summary
ConstructorDescriptionJpaCountQueryCreator
(PartTree tree, ReturnedType type, jakarta.persistence.criteria.CriteriaBuilder builder, org.springframework.data.jpa.repository.query.ParameterMetadataProvider provider) Creates a newJpaCountQueryCreator
. -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.persistence.criteria.CriteriaQuery<? extends Object>
complete
(jakarta.persistence.criteria.Predicate predicate, Sort sort, jakarta.persistence.criteria.CriteriaQuery<? extends Object> query, jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root<?> root) Template method to finalize the givenPredicate
using the givenCriteriaQuery
andCriteriaBuilder
.protected jakarta.persistence.criteria.CriteriaQuery<? extends Object>
createCriteriaQuery
(jakarta.persistence.criteria.CriteriaBuilder builder, ReturnedType type) Creates theCriteriaQuery
to apply predicates on.Methods inherited from class org.springframework.data.jpa.repository.query.JpaQueryCreator
and, complete, create, getParameterExpressions, or
Methods inherited from class org.springframework.data.repository.query.parser.AbstractQueryCreator
createQuery, createQuery
-
Constructor Details
-
JpaCountQueryCreator
public JpaCountQueryCreator(PartTree tree, ReturnedType type, jakarta.persistence.criteria.CriteriaBuilder builder, org.springframework.data.jpa.repository.query.ParameterMetadataProvider provider) Creates a newJpaCountQueryCreator
.- Parameters:
tree
-type
-builder
-provider
-
-
-
Method Details
-
createCriteriaQuery
protected jakarta.persistence.criteria.CriteriaQuery<? extends Object> createCriteriaQuery(jakarta.persistence.criteria.CriteriaBuilder builder, ReturnedType type) Description copied from class:JpaQueryCreator
Creates theCriteriaQuery
to apply predicates on.- Overrides:
createCriteriaQuery
in classJpaQueryCreator
- Parameters:
builder
- will never be null.type
- will never be null.- Returns:
- must not be null.
-
complete
protected jakarta.persistence.criteria.CriteriaQuery<? extends Object> complete(@Nullable jakarta.persistence.criteria.Predicate predicate, Sort sort, jakarta.persistence.criteria.CriteriaQuery<? extends Object> query, jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root<?> root) Description copied from class:JpaQueryCreator
Template method to finalize the givenPredicate
using the givenCriteriaQuery
andCriteriaBuilder
.- Overrides:
complete
in classJpaQueryCreator
- Returns:
-