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 Details

    • findAll

      List<T> findAll(EntityQuery query)
    • findAll

      List<T> findAll(EntityQuery query, org.springframework.data.domain.Sort sort)
    • findAll

      org.springframework.data.domain.Page<T> findAll(EntityQuery query, org.springframework.data.domain.Pageable pageable)
    • canExecute

      default boolean canExecute(@NonNull @NonNull EntityQuery query)
      Can be implemented to check if this executor can actually work with this query. Required to be implemented when using createFallbackExecutor(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 try
      fallback - to fall back to
      Returns:
      executor