Interface QuerydslPredicateExecutor<T>
- All Known Subinterfaces:
ListQuerydslPredicateExecutor<T>
public interface QuerydslPredicateExecutor<T>
Interface to allow execution of QueryDsl
Predicate instances.- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl, Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionlongcount(com.querydsl.core.types.Predicate predicate) Returns the number of instances matching the givenPredicate.booleanexists(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 all entities ordered by the givenOrderSpecifiers.findAll(com.querydsl.core.types.Predicate predicate) Returns all entities matching the givenPredicate.findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders) Returns all entities matching the givenPredicateapplying the givenOrderSpecifiers.Returns aPageof entities matching the givenPredicate.Returns all entities matching the givenPredicateapplying the givenSort.<S extends T,R>
RfindBy(com.querydsl.core.types.Predicate predicate, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction) Returns entities matching the givenPredicateapplying thequeryFunctionthat defines the query and its result type.findOne(com.querydsl.core.types.Predicate predicate) Returns a single entity matching the givenPredicateorOptional.empty()if none was found.
-
Method Details
-
findOne
Returns a single entity matching the givenPredicateorOptional.empty()if none was found.- Parameters:
predicate- must not be null.- Returns:
- a single entity matching the given
PredicateorOptional.empty()if none was found. - Throws:
IncorrectResultSizeDataAccessException- if the predicate yields more than one result.
-
findAll
Returns all entities matching the givenPredicate. In case no match could be found an emptyIterableis returned.- Parameters:
predicate- must not be null.- Returns:
- all entities matching the given
Predicate.
-
findAll
Returns all entities matching the givenPredicateapplying the givenSort. In case no match could be found an emptyIterableis returned.- Parameters:
predicate- must not be null.sort- theSortspecification to sort the results by, may beSort.unsorted(), must not be null.- Returns:
- all entities matching the given
Predicate. - Since:
- 1.10
-
findAll
Iterable<T> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders) Returns all entities matching the givenPredicateapplying the givenOrderSpecifiers. In case no match could be found an emptyIterableis returned.- Parameters:
predicate- must not be null.orders- theOrderSpecifiers to sort the results by, must not be null.- Returns:
- all entities matching the given
Predicateapplying the givenOrderSpecifiers.
-
findAll
Returns all entities ordered by the givenOrderSpecifiers.- Parameters:
orders- theOrderSpecifiers to sort the results by, must not be null.- Returns:
- all entities ordered by the given
OrderSpecifiers.
-
findAll
Returns aPageof entities matching the givenPredicate. In case no match could be found, an emptyPageis returned.- Parameters:
predicate- must not be null.pageable- may bePageable.unpaged(), must not be null.- Returns:
- a
Pageof entities matching the givenPredicate.
-
count
long count(com.querydsl.core.types.Predicate predicate) Returns the number of instances matching the givenPredicate.- Parameters:
predicate- thePredicateto count instances for, must not be null.- Returns:
- the number of instances matching the
Predicate.
-
exists
boolean exists(com.querydsl.core.types.Predicate predicate) Checks whether the data store contains elements that match the givenPredicate.- Parameters:
predicate- thePredicateto use for the existence check, must not be null.- Returns:
- true if the data store contains elements that match the given
Predicate.
-
findBy
<S extends T,R> R findBy(com.querydsl.core.types.Predicate predicate, Function<FluentQuery.FetchableFluentQuery<S>, R> 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
-