Class QuerydslJpaPredicateExecutor<T>

java.lang.Object
org.springframework.data.jpa.repository.support.QuerydslJpaPredicateExecutor<T>
All Implemented Interfaces:
org.springframework.data.querydsl.QuerydslPredicateExecutor<T>

public class QuerydslJpaPredicateExecutor<T> extends Object implements org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
Querydsl specific fragment for extending SimpleJpaRepository with an implementation of QuerydslPredicateExecutor.
Author:
Oliver Gierke, Thomas Darimont, Mark Paluch, Jocelyn Ntakpe, Christoph Strobl, Jens Schauder, Greg Turnquist, Yanming Zhou
  • Constructor Summary

    Constructors
    Constructor
    Description
    QuerydslJpaPredicateExecutor(JpaEntityInformation<T,?> entityInformation, jakarta.persistence.EntityManager entityManager, org.springframework.data.querydsl.EntityPathResolver resolver, CrudMethodMetadata metadata)
    Creates a new QuerydslJpaPredicateExecutor from the given domain class and EntityManager and uses the given EntityPathResolver to translate the domain class into an EntityPath.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    count(com.querydsl.core.types.Predicate predicate)
     
    protected com.querydsl.jpa.JPQLQuery<?>
    createCountQuery(com.querydsl.core.types.Predicate... predicate)
    Creates a new JPQLQuery count query for the given Predicate.
    protected com.querydsl.jpa.impl.AbstractJPAQuery<?,?>
    createQuery(com.querydsl.core.types.Predicate... predicate)
    Creates a new JPQLQuery for the given Predicate.
    boolean
    exists(com.querydsl.core.types.Predicate predicate)
     
    findAll(com.querydsl.core.types.OrderSpecifier<?>... orders)
     
    findAll(com.querydsl.core.types.Predicate predicate)
     
    findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders)
     
    org.springframework.data.domain.Page<T>
    findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Pageable pageable)
     
    findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Sort sort)
     
    <S extends T, R>
    R
    findBy(com.querydsl.core.types.Predicate predicate, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
     
    findOne(com.querydsl.core.types.Predicate predicate)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • QuerydslJpaPredicateExecutor

      public QuerydslJpaPredicateExecutor(JpaEntityInformation<T,?> entityInformation, jakarta.persistence.EntityManager entityManager, org.springframework.data.querydsl.EntityPathResolver resolver, @Nullable CrudMethodMetadata metadata)
      Creates a new QuerydslJpaPredicateExecutor from the given domain class and EntityManager and uses the given EntityPathResolver to translate the domain class into an EntityPath.
      Parameters:
      entityInformation - must not be null.
      entityManager - must not be null.
      resolver - must not be null.
      metadata - maybe null.
  • Method Details

    • findOne

      public Optional<T> findOne(com.querydsl.core.types.Predicate predicate)
      Specified by:
      findOne in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
    • findAll

      public List<T> findAll(com.querydsl.core.types.Predicate predicate)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
    • findAll

      public List<T> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
    • findAll

      public List<T> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Sort sort)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
    • findAll

      public List<T> findAll(com.querydsl.core.types.OrderSpecifier<?>... orders)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
    • findAll

      public org.springframework.data.domain.Page<T> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Pageable pageable)
      Specified by:
      findAll in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
    • findBy

      public <S extends T, R> R findBy(com.querydsl.core.types.Predicate predicate, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
      Specified by:
      findBy in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
    • count

      public long count(com.querydsl.core.types.Predicate predicate)
      Specified by:
      count in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
    • exists

      public boolean exists(com.querydsl.core.types.Predicate predicate)
      Specified by:
      exists in interface org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
    • createQuery

      protected com.querydsl.jpa.impl.AbstractJPAQuery<?,?> createQuery(com.querydsl.core.types.Predicate... predicate)
      Creates a new JPQLQuery for the given Predicate.
      Parameters:
      predicate -
      Returns:
      the Querydsl JPQLQuery.
    • createCountQuery

      protected com.querydsl.jpa.JPQLQuery<?> createCountQuery(@Nullable com.querydsl.core.types.Predicate... predicate)
      Creates a new JPQLQuery count query for the given Predicate.
      Parameters:
      predicate - , can be null.
      Returns:
      the Querydsl count JPQLQuery.