Class SingleOptionalQueryExecutor<T>

java.lang.Object
software.xdev.spring.data.eclipse.store.repository.query.executors.SingleOptionalQueryExecutor<T>
Type Parameters:
T - Entity-Type to query
All Implemented Interfaces:
QueryExecutor<T>

public class SingleOptionalQueryExecutor<T> extends Object implements QueryExecutor<T>
Queries entities and returns the result wrapped in an optional.
  • Constructor Details

    • SingleOptionalQueryExecutor

      public SingleOptionalQueryExecutor(WorkingCopier<T> copier, Criteria<T> criteria, org.springframework.data.domain.Sort sort)
  • Method Details

    • execute

      public Optional<T> execute(Class<T> clazz, @Nullable EntityProvider<T,?> entities, @Nullable Object[] values)
      Executes the created query over entities.

      The result is always a working copy of the entities.

      Specified by:
      execute in interface QueryExecutor<T>
      Parameters:
      clazz - of the entities
      entities - where the query is executed on
      values - for the query. These are values that might be compared to entities.
      Returns:
      an optional with the found entity. Optional.empty() if nothing was found.