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 |
invokeDelete(Serializable id)
Invokes the method equivalent to
CrudRepository.delete(Serializable). |
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> T |
invokeFindOne(Serializable id)
Invokes the method equivalent to
CrudRepository.findOne(Serializable). |
Object |
invokeQueryMethod(Method method,
Map<String,String[]> parameters,
Pageable pageable,
Sort sort)
|
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 - can 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 RepositoryInvokerpublic 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 invokeDelete(Serializable id)
RepositoryInvokerCrudRepository.delete(Serializable).
The given id is assumed to be of a type convertable into the actual identifier type of the backing repository.invokeDelete in interface RepositoryInvokerid - must not be null. throws IllegalStateException if the repository does not expose a
delete-method.public <T> T invokeFindOne(Serializable id)
RepositoryInvokerCrudRepository.findOne(Serializable).invokeFindOne in interface RepositoryInvokerid - must not be null.public Object invokeQueryMethod(Method method, Map<String,String[]> parameters, Pageable pageable, Sort sort)
RepositoryInvokerinvokeQueryMethod in interface RepositoryInvokermethod - must not be null.parameters - must not be null.pageable - can be null.sort - can be null.public 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 - can be null.sort - can be null.public <T> T invokeSave(T object)
RepositoryInvokerCrudRepository.save(Object) on the
repository.invokeSave in interface RepositoryInvokerCopyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.