Interface QuerydslPredicateExecutor<T>
public interface QuerydslPredicateExecutor<T>
Interface to allow execution of QueryDsl
Predicate
instances.- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionlong
count
(com.querydsl.core.types.Predicate predicate) Returns the number of instances matching the givenPredicate
.boolean
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 all entities ordered by the givenOrderSpecifier
s.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 givenPredicate
applying the givenOrderSpecifier
s.Returns aPage
of entities matching the givenPredicate
.Returns all entities matching the givenPredicate
applying the givenSort
.<S extends T,
R>
RfindBy
(com.querydsl.core.types.Predicate predicate, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction) Returns entities matching the givenPredicate
applying thequeryFunction
that defines the query and its result type.findOne
(com.querydsl.core.types.Predicate predicate) Returns a single entity matching the givenPredicate
orOptional.empty()
if none was found.
-
Method Details
-
findOne
Returns a single entity matching the givenPredicate
orOptional.empty()
if none was found.- Parameters:
predicate
- must not be null.- Returns:
- a single entity matching the given
Predicate
orOptional.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 emptyIterable
is returned.- Parameters:
predicate
- must not be null.- Returns:
- all entities matching the given
Predicate
.
-
findAll
Returns all entities matching the givenPredicate
applying the givenSort
. In case no match could be found an emptyIterable
is returned.- Parameters:
predicate
- 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
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 givenPredicate
applying the givenOrderSpecifier
s. In case no match could be found an emptyIterable
is returned.- Parameters:
predicate
- must not be null.orders
- theOrderSpecifier
s to sort the results by, must not be null.- Returns:
- all entities matching the given
Predicate
applying the givenOrderSpecifier
s.
-
findAll
Returns all entities ordered by the givenOrderSpecifier
s.- Parameters:
orders
- theOrderSpecifier
s to sort the results by, must not be null.- Returns:
- all entities ordered by the given
OrderSpecifier
s.
-
findAll
Returns aPage
of entities matching the givenPredicate
. In case no match could be found, an emptyPage
is returned.- Parameters:
predicate
- must not be null.pageable
- may bePageable.unpaged()
, must not be null.- Returns:
- a
Page
of entities matching the givenPredicate
.
-
count
long count(com.querydsl.core.types.Predicate predicate) Returns the number of instances matching the givenPredicate
.- Parameters:
predicate
- thePredicate
to 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
- thePredicate
to 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 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
-