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 TypeMethodDescriptionreactor.core.publisher.Mono<Long>
count
(com.querydsl.core.types.Predicate predicate) Returns aMono
emitting the number of instances matching the givenPredicate
.reactor.core.publisher.Mono<Boolean>
exists
(com.querydsl.core.types.Predicate predicate) Checks whether the data store contains elements that match the givenPredicate
.reactor.core.publisher.Flux<T>
findAll
(com.querydsl.core.types.OrderSpecifier<?>... orders) Returns aFlux
emitting all entities ordered by the givenOrderSpecifier
s.reactor.core.publisher.Flux<T>
findAll
(com.querydsl.core.types.Predicate predicate) Returns aFlux
emitting all entities matching the givenPredicate
.reactor.core.publisher.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.reactor.core.publisher.Flux<T>
<S extends T,
R, P extends org.reactivestreams.Publisher<R>>
PfindBy
(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.reactor.core.publisher.Mono<T>
findOne
(com.querydsl.core.types.Predicate predicate) Returns aMono
emitting the entity matching the givenPredicate
orMono.empty()
if none was found.
-
Method Details
-
findOne
Returns aMono
emitting the entity matching the givenPredicate
orMono.empty()
if none was found.- 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.org.springframework.dao.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
reactor.core.publisher.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 org.reactivestreams.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.- 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
-