Interface ReactiveQuerydslPredicateExecutor<T>
public interface ReactiveQuerydslPredicateExecutor<T>
Interface to issue queries using Querydsl
Intended for usage along with the
Predicate
instances. Intended for usage along with the
ReactiveCrudRepository
interface to wire in Querydslsupport.
public interface PersonRepository extends ReactiveCrudRepository<Person, String>, ReactiveQuerydslPredicateExecutor<Person> {
}
// ...
personRepository.findOne(QPerson.person.email.eq("t-800@skynet.io"))
.flatMap(t800 ->
//....
IMPORTANT: Please check the module specific documentation whether or not Querydsl is supported.- Since:
- 2.2
- Author:
- Mark Paluch, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptioncount
(com.querydsl.core.types.Predicate predicate) Returns aMono
emitting the number of instances matching the givenPredicate
.exists
(com.querydsl.core.types.Predicate predicate) Checks whether the data store contains elements that match the givenPredicate
.findAll
(com.querydsl.core.types.OrderSpecifier<?>... orders) Returns aFlux
emitting all entities ordered by the givenOrderSpecifier
s.findAll
(com.querydsl.core.types.Predicate predicate) Returns aFlux
emitting all entities matching the givenPredicate
.findAll
(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders) Returns aFlux
emitting all entities matching the givenPredicate
applying the givenOrderSpecifier
s.findBy
(com.querydsl.core.types.Predicate predicate, Function<FluentQuery.ReactiveFluentQuery<S>, P> queryFunction) Returns entities matching the givenPredicate
applying thequeryFunction
that defines the query and its result type.findOne
(com.querydsl.core.types.Predicate predicate)
-
Method Details
-
findOne
- Parameters:
predicate
- must not be null.- Returns:
- a
Mono
emitting a single entity matching the givenPredicate
orMono.empty()
if none was found. - Throws:
IllegalArgumentException
- if the required parameter is null.IncorrectResultSizeDataAccessException
- if the predicate yields more than one result.
-
findAll
Returns aFlux
emitting all entities matching the givenPredicate
. In case no match could be found,Flux
emits no items.- Parameters:
predicate
- must not be null.- Returns:
- a
Flux
emitting all entities matching the givenPredicate
one by one. - Throws:
IllegalArgumentException
- if the required parameter is null.
-
findAll
Returns aFlux
emitting all entities matching the givenPredicate
applying the givenSort
. In case no match could be found,Flux
emits no items.- Parameters:
predicate
- must not be null.sort
- theSort
specification to sort the results by, may beSort.unsorted()
, must not be null.- Returns:
- a
Flux
emitting all entities matching the givenPredicate
one by one. - Throws:
IllegalArgumentException
- if one of the required parameters is null.
-
findAll
Flux<T> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders) Returns aFlux
emitting all entities matching the givenPredicate
applying the givenOrderSpecifier
s. In case no match could be found,Flux
emits no items.- Parameters:
predicate
- must not be null.orders
- theOrderSpecifier
s to sort the results by.- Returns:
- a
Flux
emitting all entities matching the givenPredicate
applying the givenOrderSpecifier
s. - Throws:
IllegalArgumentException
- if one of the required parameter is null, or contains a null value.
-
findAll
Returns aFlux
emitting all entities ordered by the givenOrderSpecifier
s.- Parameters:
orders
- theOrderSpecifier
s to sort the results by.- Returns:
- a
Flux
emitting all entities ordered by the givenOrderSpecifier
s. - Throws:
IllegalArgumentException
- one of theOrderSpecifiers
is null.
-
count
Returns aMono
emitting the number of instances matching the givenPredicate
.- Parameters:
predicate
- thePredicate
to count instances for, must not be null.- Returns:
- a
Mono
emitting the number of instances matching thePredicate
or0
if none found. - Throws:
IllegalArgumentException
- if the required parameter is null.
-
exists
Checks whether the data store contains elements that match the givenPredicate
.- Parameters:
predicate
- thePredicate
to use for the existence check, must not be null.- Returns:
- a
Mono
emitting true if the data store contains elements that match the givenPredicate
, false otherwise. - Throws:
IllegalArgumentException
- if the required parameter is null.
-
findBy
<S extends T,R, P findByP extends Publisher<R>> (com.querydsl.core.types.Predicate predicate, Function<FluentQuery.ReactiveFluentQuery<S>, P> queryFunction) Returns entities matching the givenPredicate
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:
predicate
- must not be null.queryFunction
- the query function defining projection, sorting, and the result type- Returns:
- all entities matching the given
Predicate
. - Since:
- 2.6
-