Interface ReactiveQueryByExampleExecutor<T>

Type Parameters:
T -

public interface ReactiveQueryByExampleExecutor<T>
Interface to allow execution of Query by Example Example instances using a reactive infrastructure.
Since:
2.0
Author:
Mark Paluch, Christoph Strobl
  • Method Details

    • findOne

      <S extends T> Mono<S> findOne(Example<S> example)
      Returns a single entity matching the given Example or Mono.empty() if none was found.
      Parameters:
      example - must not be null.
      Returns:
      a single entity matching the given Example or Mono.empty() if none was found.
      Throws:
      IncorrectResultSizeDataAccessException - via Mono.error(Throwable) if the example yields more than one result.
    • findAll

      <S extends T> Flux<S> findAll(Example<S> example)
      Returns all entities matching the given Example. In case no match could be found Flux.empty() is returned.
      Parameters:
      example - must not be null.
      Returns:
      all entities matching the given Example.
    • findAll

      <S extends T> Flux<S> findAll(Example<S> example, Sort sort)
      Returns all entities matching the given Example applying the given Sort. In case no match could be found Flux.empty() is returned.
      Parameters:
      example - must not be null.
      sort - the Sort specification to sort the results by, may be Sort.unsorted(), must not be null.
      Returns:
      all entities matching the given Example.
    • count

      <S extends T> Mono<Long> count(Example<S> example)
      Returns the number of instances matching the given Example.
      Parameters:
      example - the Example to count instances for. Must not be null.
      Returns:
      the number of instances matching the Example.
    • exists

      <S extends T> Mono<Boolean> exists(Example<S> example)
      Checks whether the data store contains elements that match the given Example.
      Parameters:
      example - the Example to use for the existence check. Must not be null.
      Returns:
      true if the data store contains elements that match the given Example.
    • findBy

      <S extends T, R, P extends Publisher<R>> P findBy(Example<S> example, Function<FluentQuery.ReactiveFluentQuery<S>,P> queryFunction)
      Returns entities matching the given Example applying the queryFunction that defines the query and its result type.

      The query object used with queryFunction is only valid inside the findBy(…) method call. This requires the query function to return a query result and not the FluentQuery object itself to ensure the query is executed inside the findBy(…) method.

      Parameters:
      example - must not be null.
      queryFunction - the query function defining projection, sorting, and the result type
      Returns:
      all entities matching the given Example.
      Since:
      2.6