Interface QuerydslPredicateExecutor<T>

All Known Subinterfaces:
ListQuerydslPredicateExecutor<T>

public interface QuerydslPredicateExecutor<T>
Interface to allow execution of QueryDsl Predicate instances.
Author:
Oliver Gierke, Thomas Darimont, Christoph Strobl, Mark Paluch
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    count(com.querydsl.core.types.Predicate predicate)
    Returns the number of instances matching the given Predicate.
    boolean
    exists(com.querydsl.core.types.Predicate predicate)
    Checks whether the data store contains elements that match the given Predicate.
    findAll(com.querydsl.core.types.OrderSpecifier<?>... orders)
    Returns all entities ordered by the given OrderSpecifiers.
    findAll(com.querydsl.core.types.Predicate predicate)
    Returns all entities matching the given Predicate.
    findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders)
    Returns all entities matching the given Predicate applying the given OrderSpecifiers.
    findAll(com.querydsl.core.types.Predicate predicate, Pageable pageable)
    Returns a Page of entities matching the given Predicate.
    findAll(com.querydsl.core.types.Predicate predicate, Sort sort)
    Returns all entities matching the given Predicate applying the given Sort.
    <S extends T, R>
    R
    findBy(com.querydsl.core.types.Predicate predicate, Function<FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
    Returns entities matching the given Predicate applying the queryFunction that defines the query and its result type.
    findOne(com.querydsl.core.types.Predicate predicate)
    Returns a single entity matching the given Predicate or Optional.empty() if none was found.
  • Method Details

    • findOne

      Optional<T> findOne(com.querydsl.core.types.Predicate predicate)
      Returns a single entity matching the given Predicate or Optional.empty() if none was found.
      Parameters:
      predicate - must not be null.
      Returns:
      a single entity matching the given Predicate or Optional.empty() if none was found.
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if the predicate yields more than one result.
    • findAll

      Iterable<T> findAll(com.querydsl.core.types.Predicate predicate)
      Returns all entities matching the given Predicate. In case no match could be found an empty Iterable is returned.
      Parameters:
      predicate - must not be null.
      Returns:
      all entities matching the given Predicate.
    • findAll

      Iterable<T> findAll(com.querydsl.core.types.Predicate predicate, Sort sort)
      Returns all entities matching the given Predicate applying the given Sort. In case no match could be found an empty Iterable is returned.
      Parameters:
      predicate - must not be null.
      sort - the Sort specification to sort the results by, may be Sort.unsorted(), must not be null.
      Returns:
      all entities matching the given Predicate.
      Since:
      1.10
    • findAll

      Iterable<T> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders)
      Returns all entities matching the given Predicate applying the given OrderSpecifiers. In case no match could be found an empty Iterable is returned.
      Parameters:
      predicate - must not be null.
      orders - the OrderSpecifiers to sort the results by, must not be null.
      Returns:
      all entities matching the given Predicate applying the given OrderSpecifiers.
    • findAll

      Iterable<T> findAll(com.querydsl.core.types.OrderSpecifier<?>... orders)
      Returns all entities ordered by the given OrderSpecifiers.
      Parameters:
      orders - the OrderSpecifiers to sort the results by, must not be null.
      Returns:
      all entities ordered by the given OrderSpecifiers.
    • findAll

      Page<T> findAll(com.querydsl.core.types.Predicate predicate, Pageable pageable)
      Returns a Page of entities matching the given Predicate. In case no match could be found, an empty Page is returned.
      Parameters:
      predicate - must not be null.
      pageable - may be Pageable.unpaged(), must not be null.
      Returns:
      a Page of entities matching the given Predicate.
    • count

      long count(com.querydsl.core.types.Predicate predicate)
      Returns the number of instances matching the given Predicate.
      Parameters:
      predicate - the Predicate to count instances for, must not be null.
      Returns:
      the number of instances matching the Predicate.
    • exists

      boolean exists(com.querydsl.core.types.Predicate predicate)
      Checks whether the data store contains elements that match the given Predicate.
      Parameters:
      predicate - the Predicate to use for the existence check, must not be null.
      Returns:
      true if the data store contains elements that match the given Predicate.
    • findBy

      <S extends T, R> R findBy(com.querydsl.core.types.Predicate predicate, Function<FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
      Returns entities matching the given Predicate applying the queryFunction that defines the query and its result type.
      Parameters:
      predicate - must not be null.
      queryFunction - the query function defining projection, sorting, and the result type
      Returns:
      all entities matching the given Predicate.
      Since:
      2.6