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 TypeMethodDescriptionReturns the number of instances matching the givenExample
.Checks whether the data store contains elements that match the givenExample
.<S extends T>
reactor.core.publisher.Flux<S>Returns all entities matching the givenExample
.<S extends T>
reactor.core.publisher.Flux<S><S extends T,
R, P extends org.reactivestreams.Publisher<R>>
PfindBy
(Example<S> example, Function<FluentQuery.ReactiveFluentQuery<S>, P> queryFunction) Returns entities matching the givenExample
applying thequeryFunction
that defines the query and its result type.<S extends T>
reactor.core.publisher.Mono<S>Returns a single entity matching the givenExample
orMono.empty()
if none was found.
-
Method Details
-
findOne
Returns a single entity matching the givenExample
orMono.empty()
if none was found.- Parameters:
example
- must not be null.- Returns:
- a single entity matching the given
Example
orMono.empty()
if none was found. - Throws:
IncorrectResultSizeDataAccessException
- viaMono.error(Throwable)
if the example yields more than one result.
-
findAll
Returns all entities matching the givenExample
. In case no match could be foundFlux.empty()
is returned.- Parameters:
example
- must not be null.- Returns:
- all entities matching the given
Example
.
-
findAll
Returns all entities matching the givenExample
applying the givenSort
. In case no match could be foundFlux.empty()
is returned.- Parameters:
example
- must not be null.sort
- theSort
specification to sort the results by, may beSort.unsorted()
, must not be null.- Returns:
- all entities matching the given
Example
.
-
count
Returns the number of instances matching the givenExample
. -
exists
Checks whether the data store contains elements that match the givenExample
. -
findBy
<S extends T,R, P findByP extends org.reactivestreams.Publisher<R>> (Example<S> example, Function<FluentQuery.ReactiveFluentQuery<S>, P> queryFunction) Returns entities matching the givenExample
applying thequeryFunction
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
-