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 Summary

    Modifier and Type
    Method
    Description
    <S extends T>
    reactor.core.publisher.Mono<Long>
    count(Example<S> example)
    Returns the number of instances matching the given Example.
    <S extends T>
    reactor.core.publisher.Mono<Boolean>
    exists(Example<S> example)
    Checks whether the data store contains elements that match the given Example.
    <S extends T>
    reactor.core.publisher.Flux<S>
    findAll(Example<S> example)
    Returns all entities matching the given Example.
    <S extends T>
    reactor.core.publisher.Flux<S>
    findAll(Example<S> example, Sort sort)
    Returns all entities matching the given Example applying the given Sort.
    <S extends T, R, P extends org.reactivestreams.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.
    <S extends T>
    reactor.core.publisher.Mono<S>
    findOne(Example<S> example)
    Returns a single entity matching the given Example or Mono.empty() if none was found.
  • Method Details

    • findOne

      <S extends T> reactor.core.publisher.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> reactor.core.publisher.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> reactor.core.publisher.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> reactor.core.publisher.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> reactor.core.publisher.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 org.reactivestreams.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.
      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