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
.Returns all entities matching the givenExample
.findBy
(Example<S> example, Function<FluentQuery.ReactiveFluentQuery<S>, P> queryFunction) Returns entities matching the givenExample
applying thequeryFunction
that defines the query and its result type.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 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.The query object used with
queryFunction
is only valid inside thefindBy(…)
method call. This requires the query function to return a query result and not theFluentQuery
object itself to ensure the query is executed inside thefindBy(…)
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
-