org.springframework.data.querydsl

## Class QuerydslRepositoryInvokerAdapter

- java.lang.Object
- - org.springframework.data.querydsl.QuerydslRepositoryInvokerAdapter

All Implemented Interfaces:
  RepositoryInvocationInformation, RepositoryInvoker

    public class QuerydslRepositoryInvokerAdapter
    extends Object
    implements RepositoryInvoker

`RepositoryInvoker` that is aware of a `QuerydslPredicateExecutor` and `Predicate` to be executed for all flavors of `findAll(…)`. All other calls are forwarded to the configured delegate.

Author:
  Oliver Gierke

### Constructor Summary

Constructors
Constructor and Description
`QuerydslRepositoryInvokerAdapter(RepositoryInvoker delegate, QuerydslPredicateExecutor<Object> executor, com.querydsl.core.types.Predicate predicate)` Creates a new `QuerydslRepositoryInvokerAdapter` for the given delegate `RepositoryInvoker`, `QuerydslPredicateExecutor` and Querydsl `Predicate`.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `hasDeleteMethod()` Returns whether the repository has a method to delete objects.
`boolean` `hasFindAllMethod()` Returns whether the repository has a method to find all objects.
`boolean` `hasFindOneMethod()` Returns whether the repository has a method to find a single object.
`boolean` `hasSaveMethod()` Returns whether the repository has a method to save objects.
`void` `invokeDeleteById(Object id)` Invokes the method equivalent to `CrudRepository.deleteById(Object)`.

`Iterable<Object>`

`invokeFindAll(Pageable pageable)`
Invokes the find-all method of the underlying repository using the method taking a `Pageable` as parameter if available (i.e. the equivalent to `PagingAndSortingRepository.findAll(Pageable)`), using the method taking a `Sort` if available (i.e. the equivalent to `PagingAndSortingRepository.findAll(Sort)` by extracting the `Sort` contained in the given `Pageable`) or the plain equivalent to `CrudRepository.findAll()`.

`Iterable<Object>` `invokeFindAll(Sort sort)` Invokes the find-all method of the underlying repository using the method taking a `Sort` as parameter if available (i.e. the equivalent to `PagingAndSortingRepository.findAll(Sort)`) or the plain equivalent to `CrudRepository.findAll()`.
`<T> Optional<T>` `invokeFindById(Object id)` Invokes the method equivalent to `CrudRepository.findById(Object)`.
`Optional<Object>` `invokeQueryMethod(Method method, MultiValueMap<String,? extends Object> parameters, Pageable pageable, Sort sort)` Invokes the query method backed by the given `Method` using the given parameters, `Pageable` and `Sort`.
`<T> T` `invokeSave(T object)` Invokes the method equivalent to `CrudRepository.save(Object)` on the repository.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### QuerydslRepositoryInvokerAdapter

    public QuerydslRepositoryInvokerAdapter(RepositoryInvoker delegate,
                                            QuerydslPredicateExecutor<Object> executor,
                                            com.querydsl.core.types.Predicate predicate)

Creates a new `QuerydslRepositoryInvokerAdapter` for the given delegate `RepositoryInvoker`, `QuerydslPredicateExecutor` and Querydsl `Predicate`.

Parameters:
  `delegate` - must not be null.
  `executor` - must not be null.
  `predicate` - can be null.

### Method Detail

#### invokeFindAll

    public Iterable<Object> invokeFindAll(Pageable pageable)

Description copied from interface: `RepositoryInvoker`
Invokes the find-all method of the underlying repository using the method taking a `Pageable` as parameter if available (i.e. the equivalent to `PagingAndSortingRepository.findAll(Pageable)`), using the method taking a `Sort` if available (i.e. the equivalent to `PagingAndSortingRepository.findAll(Sort)` by extracting the `Sort` contained in the given `Pageable`) or the plain equivalent to `CrudRepository.findAll()`.

Specified by:
  `invokeFindAll` in interface `RepositoryInvoker`
Parameters:
  `pageable` - can be null.
Returns:
  the result of the invocation of the find-all method.

#### invokeFindAll

    public Iterable<Object> invokeFindAll(Sort sort)

Description copied from interface: `RepositoryInvoker`
Invokes the find-all method of the underlying repository using the method taking a `Sort` as parameter if available (i.e. the equivalent to `PagingAndSortingRepository.findAll(Sort)`) or the plain equivalent to `CrudRepository.findAll()`.

Specified by:
  `invokeFindAll` in interface `RepositoryInvoker`
Returns:
  the result of the invocation of the find-all method.

#### hasDeleteMethod

    public boolean hasDeleteMethod()

Description copied from interface: `RepositoryInvocationInformation`
Returns whether the repository has a method to delete objects.

Specified by:
  `hasDeleteMethod` in interface `RepositoryInvocationInformation`
Returns:

#### hasFindAllMethod

    public boolean hasFindAllMethod()

Description copied from interface: `RepositoryInvocationInformation`
Returns whether the repository has a method to find all objects.

Specified by:
  `hasFindAllMethod` in interface `RepositoryInvocationInformation`
Returns:

#### hasFindOneMethod

    public boolean hasFindOneMethod()

Description copied from interface: `RepositoryInvocationInformation`
Returns whether the repository has a method to find a single object.

Specified by:
  `hasFindOneMethod` in interface `RepositoryInvocationInformation`
Returns:

#### hasSaveMethod

    public boolean hasSaveMethod()

Description copied from interface: `RepositoryInvocationInformation`
Returns whether the repository has a method to save objects.

Specified by:
  `hasSaveMethod` in interface `RepositoryInvocationInformation`
Returns:

#### invokeDeleteById

    public void invokeDeleteById(Object id)

Description copied from interface: `RepositoryInvoker`
Invokes the method equivalent to `CrudRepository.deleteById(Object)`. The given id is assumed to be of a type convertible into the actual identifier type of the backing repository.

Specified by:
  `invokeDeleteById` in interface `RepositoryInvoker`
Parameters:
  `id` - must not be null.

#### invokeFindById

    public <T> Optional<T> invokeFindById(Object id)

Description copied from interface: `RepositoryInvoker`
Invokes the method equivalent to `CrudRepository.findById(Object)`.

Specified by:
  `invokeFindById` in interface `RepositoryInvoker`
Parameters:
  `id` - must not be null.
Returns:
  the entity with the given id.

#### invokeQueryMethod

    public Optional<Object> invokeQueryMethod(Method method,
                                              MultiValueMap<String,? extends Object> parameters,
                                              Pageable pageable,
                                              Sort sort)

Description copied from interface: `RepositoryInvoker`
Invokes the query method backed by the given `Method` using the given parameters, `Pageable` and `Sort`.

Specified by:
  `invokeQueryMethod` in interface `RepositoryInvoker`
Parameters:
  `method` - must not be null.
  `parameters` - must not be null.
  `pageable` - must not be null.
  `sort` - must not be null.
Returns:
  the result of the invoked query method.

#### invokeSave

    public <T> T invokeSave(T object)

Description copied from interface: `RepositoryInvoker`
Invokes the method equivalent to `CrudRepository.save(Object)` on the repository.

Specified by:
  `invokeSave` in interface `RepositoryInvoker`
Returns:
  the result of the invocation of the save method