Interface EntityQueryExecutor<T>
- All Known Subinterfaces:
EntityQueryFacade<T>
- All Known Implementing Classes:
AbstractEntityQueryExecutor,CollectionEntityQueryExecutor,ElasticEntityQueryExecutor,EntityQueryJpaExecutor,EntityQueryQueryDslExecutor,PagingAndSortingEntityQueryExecutor,SimpleEntityQueryFacade
public interface EntityQueryExecutor<T>
Simple abstraction interface for defining simple generic queries (in the form of
EntityQuery)
that can be used to fetch one or more entities. Used as an additional abstraction for the specific
JPA, QueryDsl repositories.
Only accepts a translated and executable EntityQuery.- Author:
- Arne Vandamme
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanExecute(@NonNull EntityQuery query) Can be implemented to check if this executor can actually work with this query.static <U> EntityQueryExecutor<U>createFallbackExecutor(@NonNull EntityQueryExecutor<U> initial, @NonNull EntityQueryExecutor<U> fallback) Create a new executor that first tries an original executor and falls back to another one if the first is not able to execute the query passed in.findAll(EntityQuery query) org.springframework.data.domain.Page<T>findAll(EntityQuery query, org.springframework.data.domain.Pageable pageable) findAll(EntityQuery query, org.springframework.data.domain.Sort sort)
-
Method Details
-
findAll
-
findAll
-
findAll
org.springframework.data.domain.Page<T> findAll(EntityQuery query, org.springframework.data.domain.Pageable pageable) -
canExecute
Can be implemented to check if this executor can actually work with this query. Required to be implemented when usingcreateFallbackExecutor(EntityQueryExecutor, EntityQueryExecutor).- Parameters:
query- to execute- Returns:
- true if the query can be executed by this executor
-
createFallbackExecutor
static <U> EntityQueryExecutor<U> createFallbackExecutor(@NonNull @NonNull EntityQueryExecutor<U> initial, @NonNull @NonNull EntityQueryExecutor<U> fallback) Create a new executor that first tries an original executor and falls back to another one if the first is not able to execute the query passed in.- Parameters:
initial- executor to tryfallback- to fall back to- Returns:
- executor
-