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 aMonoemitting 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 aFluxemitting all entities ordered by the givenOrderSpecifiers.reactor.core.publisher.Flux<T>findAll(com.querydsl.core.types.Predicate predicate) Returns aFluxemitting all entities matching the givenPredicate.reactor.core.publisher.Flux<T>findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders) Returns aFluxemitting all entities matching the givenPredicateapplying the givenOrderSpecifiers.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 givenPredicateapplying thequeryFunctionthat defines the query and its result type.reactor.core.publisher.Mono<T>findOne(com.querydsl.core.types.Predicate predicate) Returns aMonoemitting the entity matching the givenPredicateorMono.empty()if none was found.
-
Method Details
-
findOne
Returns aMonoemitting the entity matching the givenPredicateorMono.empty()if none was found.- Parameters:
predicate- must not be null.- Returns:
- a
Monoemitting a single entity matching the givenPredicateorMono.empty()if none was found. - Throws:
IllegalArgumentException- if the required parameter is null.IncorrectResultSizeDataAccessException- if the predicate yields more than one result.
-
findAll
Returns aFluxemitting all entities matching the givenPredicate. In case no match could be found,Fluxemits no items.- Parameters:
predicate- must not be null.- Returns:
- a
Fluxemitting all entities matching the givenPredicateone by one. - Throws:
IllegalArgumentException- if the required parameter is null.
-
findAll
Returns aFluxemitting all entities matching the givenPredicateapplying the givenSort. In case no match could be found,Fluxemits no items.- Parameters:
predicate- must not be null.sort- theSortspecification to sort the results by, may beSort.unsorted(), must not be null.- Returns:
- a
Fluxemitting all entities matching the givenPredicateone 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 aFluxemitting all entities matching the givenPredicateapplying the givenOrderSpecifiers. In case no match could be found,Fluxemits no items.- Parameters:
predicate- must not be null.orders- theOrderSpecifiers to sort the results by.- Returns:
- a
Fluxemitting all entities matching the givenPredicateapplying the givenOrderSpecifiers. - Throws:
IllegalArgumentException- if one of the required parameter is null, or contains a null value.
-
findAll
Returns aFluxemitting all entities ordered by the givenOrderSpecifiers.- Parameters:
orders- theOrderSpecifiers to sort the results by.- Returns:
- a
Fluxemitting all entities ordered by the givenOrderSpecifiers. - Throws:
IllegalArgumentException- one of theOrderSpecifiersis null.
-
count
Returns aMonoemitting the number of instances matching the givenPredicate.- Parameters:
predicate- thePredicateto count instances for, must not be null.- Returns:
- a
Monoemitting the number of instances matching thePredicateor0if none found. - Throws:
IllegalArgumentException- if the required parameter is null.
-
exists
Checks whether the data store contains elements that match the givenPredicate.- Parameters:
predicate- thePredicateto use for the existence check, must not be null.- Returns:
- a
Monoemitting 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 givenPredicateapplying thequeryFunctionthat 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
-