org.springframework.data.querydsl

## Interface QuerydslPredicateExecutor<T>

    public interface QuerydslPredicateExecutor<T>

Interface to allow execution of QueryDsl `Predicate` instances.

Author:
  Oliver Gierke, Thomas Darimont, Christoph Strobl, Mark Paluch

### Method Summary

All Methods Instance Methods Abstract Methods
`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`.
`Iterable<T>` `findAll(com.querydsl.core.types.OrderSpecifier<?>... orders)` Returns all entities ordered by the given `OrderSpecifier`s.
`Iterable<T>` `findAll(com.querydsl.core.types.Predicate predicate)` Returns all entities matching the given `Predicate`.
`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 `OrderSpecifier`s.
`Page<T>` `findAll(com.querydsl.core.types.Predicate predicate, Pageable pageable)` Returns a `Page` of entities matching the given `Predicate`.
`Iterable<T>` `findAll(com.querydsl.core.types.Predicate predicate, Sort sort)` Returns all entities matching the given `Predicate` applying the given `Sort`.
`Optional<T>` `findOne(com.querydsl.core.types.Predicate predicate)` Returns a single entity matching the given `Predicate` or `Optional.empty()` if none was found.

### Method Detail

#### 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:
  `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 `OrderSpecifier`s. In case no match could be found an empty `Iterable` is returned.

Parameters:
  `predicate` - must not be null.
  `orders` - the `OrderSpecifier`s to sort the results by, must not be null.
Returns:
  all entities matching the given `Predicate` applying the given `OrderSpecifier`s.

#### findAll

    Iterable<T> findAll(com.querydsl.core.types.OrderSpecifier<?>... orders)

Returns all entities ordered by the given `OrderSpecifier`s.

Parameters:
  `orders` - the `OrderSpecifier`s to sort the results by, must not be null.
Returns:
  all entities ordered by the given `OrderSpecifier`s.

#### 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`.