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.| 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. |
| Modifier and Type | Method and Description |
|---|---|
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)
|
<T> T |
invokeSave(T object)
Invokes the method equivalent to
CrudRepository.save(Object) on the
repository. |
public QuerydslRepositoryInvokerAdapter(RepositoryInvoker delegate, QuerydslPredicateExecutor<Object> executor, com.querydsl.core.types.Predicate predicate)
QuerydslRepositoryInvokerAdapter for the given delegate RepositoryInvoker,
QuerydslPredicateExecutor and Querydsl Predicate.delegate - must not be null.executor - must not be null.predicate - can be null.public Iterable<Object> invokeFindAll(Pageable pageable)
RepositoryInvokerPageable 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().invokeFindAll in interface RepositoryInvokerpageable - must not be null.public Iterable<Object> invokeFindAll(Sort sort)
RepositoryInvokerSort as parameter if
available (i.e. the equivalent to
PagingAndSortingRepository.findAll(Sort)) or the plain equivalent to
CrudRepository.findAll().invokeFindAll in interface RepositoryInvokersort - must not be null.public boolean hasDeleteMethod()
RepositoryInvocationInformationhasDeleteMethod in interface RepositoryInvocationInformationpublic boolean hasFindAllMethod()
RepositoryInvocationInformationhasFindAllMethod in interface RepositoryInvocationInformationpublic boolean hasFindOneMethod()
RepositoryInvocationInformationhasFindOneMethod in interface RepositoryInvocationInformationpublic boolean hasSaveMethod()
RepositoryInvocationInformationhasSaveMethod in interface RepositoryInvocationInformationpublic void invokeDeleteById(Object id)
RepositoryInvokerCrudRepository.deleteById(Object). The
given id is assumed to be of a type convertible into the actual identifier type of the backing repository.invokeDeleteById in interface RepositoryInvokerid - must not be null.public <T> Optional<T> invokeFindById(Object id)
RepositoryInvokerCrudRepository.findById(Object).invokeFindById in interface RepositoryInvokerid - must not be null.public Optional<Object> invokeQueryMethod(Method method, MultiValueMap<String,? extends Object> parameters, Pageable pageable, Sort sort)
RepositoryInvokerinvokeQueryMethod in interface RepositoryInvokermethod - must not be null.parameters - must not be null.pageable - must not be null.sort - must not be null.public <T> T invokeSave(T object)
RepositoryInvokerCrudRepository.save(Object) on the
repository.invokeSave in interface RepositoryInvokerCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.