Class QuerydslMongoPredicateExecutor<T>
java.lang.Object
org.springframework.data.mongodb.repository.support.QuerydslMongoPredicateExecutor<T>
- All Implemented Interfaces:
org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
public class QuerydslMongoPredicateExecutor<T>
extends Object
implements org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
MongoDB-specific
QuerydslPredicateExecutor
that allows execution Predicate
s in various forms.- Since:
- 2.0
- Author:
- Oliver Gierke, Thomas Darimont, Mark Paluch, Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorDescriptionQuerydslMongoPredicateExecutor
(MongoEntityInformation<T, ?> entityInformation, MongoOperations mongoOperations) Creates a newQuerydslMongoPredicateExecutor
for the givenMongoEntityInformation
andMongoOperations
.QuerydslMongoPredicateExecutor
(MongoEntityInformation<T, ?> entityInformation, MongoOperations mongoOperations, org.springframework.data.querydsl.EntityPathResolver resolver) Creates a newQuerydslMongoPredicateExecutor
for the givenMongoEntityInformation
,MongoOperations
andEntityPathResolver
. -
Method Summary
Modifier and TypeMethodDescriptionlong
count
(com.querydsl.core.types.Predicate predicate) boolean
exists
(com.querydsl.core.types.Predicate predicate) findAll
(com.querydsl.core.types.OrderSpecifier<?>... orders) findAll
(com.querydsl.core.types.Predicate predicate) findAll
(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders) org.springframework.data.domain.Page<T>
findAll
(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Pageable pageable) findAll
(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Sort sort) <S extends T,
R>
RfindBy
(com.querydsl.core.types.Predicate predicate, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>, R> queryFunction) findOne
(com.querydsl.core.types.Predicate predicate) protected org.springframework.data.mongodb.repository.support.SpringDataMongodbSerializer
protected static <E> com.querydsl.core.types.dsl.PathBuilder<E>
pathBuilderFor
(com.querydsl.core.types.EntityPath<E> path) protected com.querydsl.core.types.OrderSpecifier<?>
toOrder
(org.springframework.data.domain.Sort.Order order) Transforms a plainSort.Order
into a Querydsl specificOrderSpecifier
.protected List<com.querydsl.core.types.OrderSpecifier<?>>
toOrderSpecifiers
(org.springframework.data.domain.Sort sort) Converts the givenSort
toOrderSpecifier
.protected org.springframework.data.repository.core.EntityInformation<T,
?>
-
Constructor Details
-
QuerydslMongoPredicateExecutor
public QuerydslMongoPredicateExecutor(MongoEntityInformation<T, ?> entityInformation, MongoOperations mongoOperations) Creates a newQuerydslMongoPredicateExecutor
for the givenMongoEntityInformation
andMongoOperations
. Uses theSimpleEntityPathResolver
to create anEntityPath
for the given domain class.- Parameters:
entityInformation
- must not be null.mongoOperations
- must not be null.
-
QuerydslMongoPredicateExecutor
public QuerydslMongoPredicateExecutor(MongoEntityInformation<T, ?> entityInformation, MongoOperations mongoOperations, org.springframework.data.querydsl.EntityPathResolver resolver) Creates a newQuerydslMongoPredicateExecutor
for the givenMongoEntityInformation
,MongoOperations
andEntityPathResolver
.- Parameters:
entityInformation
- must not be null.mongoOperations
- must not be null.resolver
- must not be null.
-
-
Method Details
-
findOne
- Specified by:
findOne
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
findAll
- Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
findAll
public List<T> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders) - Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
findAll
public List<T> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Sort sort) - Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
findAll
- Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
findAll
public org.springframework.data.domain.Page<T> findAll(com.querydsl.core.types.Predicate predicate, org.springframework.data.domain.Pageable pageable) - Specified by:
findAll
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
count
public long count(com.querydsl.core.types.Predicate predicate) - Specified by:
count
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
exists
public boolean exists(com.querydsl.core.types.Predicate predicate) - Specified by:
exists
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
findBy
public <S extends T,R> R findBy(com.querydsl.core.types.Predicate predicate, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>, R> queryFunction) - Specified by:
findBy
in interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
pathBuilderFor
protected static <E> com.querydsl.core.types.dsl.PathBuilder<E> pathBuilderFor(com.querydsl.core.types.EntityPath<E> path) -
typeInformation
-
mongodbSerializer
protected org.springframework.data.mongodb.repository.support.SpringDataMongodbSerializer mongodbSerializer() -
toOrder
protected com.querydsl.core.types.OrderSpecifier<?> toOrder(org.springframework.data.domain.Sort.Order order) Transforms a plainSort.Order
into a Querydsl specificOrderSpecifier
.- Parameters:
order
-- Returns:
-
toOrderSpecifiers
protected List<com.querydsl.core.types.OrderSpecifier<?>> toOrderSpecifiers(org.springframework.data.domain.Sort sort) Converts the givenSort
toOrderSpecifier
.- Parameters:
sort
-- Returns:
-