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

public class JpaCountQueryCreator extends JpaQueryCreator
Special JpaQueryCreator that creates a count projecting query.
Author:
Oliver Gierke, Marc Lefran├žois, Mark Paluch, Greg Turnquist
  • Constructor Details

    • JpaCountQueryCreator

      public JpaCountQueryCreator(PartTree tree, ReturnedType type, jakarta.persistence.criteria.CriteriaBuilder builder, org.springframework.data.jpa.repository.query.ParameterMetadataProvider provider)
      Creates a new JpaCountQueryCreator.
      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 the CriteriaQuery to apply predicates on.
      Overrides:
      createCriteriaQuery in class JpaQueryCreator
      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 given Predicate using the given CriteriaQuery and CriteriaBuilder.
      Overrides:
      complete in class JpaQueryCreator
      Returns: