Class QuerydslJpaPredicateExecutor<T>
java.lang.Object
org.springframework.data.jpa.repository.support.QuerydslJpaPredicateExecutor<T>
- All Implemented Interfaces:
org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
public class QuerydslJpaPredicateExecutor<T>
extends Object
implements org.springframework.data.querydsl.QuerydslPredicateExecutor<T>
Querydsl specific fragment for extending
SimpleJpaRepository with an implementation of
QuerydslPredicateExecutor.- Author:
- Oliver Gierke, Thomas Darimont, Mark Paluch, Jocelyn Ntakpe, Christoph Strobl, Jens Schauder, Greg Turnquist, Yanming Zhou
-
Constructor Summary
ConstructorsConstructorDescriptionQuerydslJpaPredicateExecutor(JpaEntityInformation<T, ?> entityInformation, jakarta.persistence.EntityManager entityManager, org.springframework.data.querydsl.EntityPathResolver resolver, CrudMethodMetadata metadata) Creates a newQuerydslJpaPredicateExecutorfrom the given domain class andEntityManagerand uses the givenEntityPathResolverto translate the domain class into anEntityPath. -
Method Summary
Modifier and TypeMethodDescriptionlongcount(com.querydsl.core.types.Predicate predicate) protected com.querydsl.jpa.JPQLQuery<?>createCountQuery(com.querydsl.core.types.Predicate... predicate) Creates a newJPQLQuerycount query for the givenPredicate.protected com.querydsl.jpa.impl.AbstractJPAQuery<?,?> createQuery(com.querydsl.core.types.Predicate... predicate) Creates a newJPQLQueryfor the givenPredicate.booleanexists(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)
-
Constructor Details
-
QuerydslJpaPredicateExecutor
public QuerydslJpaPredicateExecutor(JpaEntityInformation<T, ?> entityInformation, jakarta.persistence.EntityManager entityManager, org.springframework.data.querydsl.EntityPathResolver resolver, @Nullable CrudMethodMetadata metadata) Creates a newQuerydslJpaPredicateExecutorfrom the given domain class andEntityManagerand uses the givenEntityPathResolverto translate the domain class into anEntityPath.- Parameters:
entityInformation- must not be null.entityManager- must not be null.resolver- must not be null.metadata- maybe null.
-
-
Method Details
-
findOne
- Specified by:
findOnein interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
findAll
- Specified by:
findAllin 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:
findAllin 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:
findAllin interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
findAll
- Specified by:
findAllin 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:
findAllin 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:
findByin interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
count
public long count(com.querydsl.core.types.Predicate predicate) - Specified by:
countin interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
exists
public boolean exists(com.querydsl.core.types.Predicate predicate) - Specified by:
existsin interfaceorg.springframework.data.querydsl.QuerydslPredicateExecutor<T>
-
createQuery
protected com.querydsl.jpa.impl.AbstractJPAQuery<?,?> createQuery(com.querydsl.core.types.Predicate... predicate) Creates a newJPQLQueryfor the givenPredicate.- Parameters:
predicate-- Returns:
- the Querydsl
JPQLQuery.
-
createCountQuery
protected com.querydsl.jpa.JPQLQuery<?> createCountQuery(@Nullable com.querydsl.core.types.Predicate... predicate) Creates a newJPQLQuerycount query for the givenPredicate.- Parameters:
predicate- , can be null.- Returns:
- the Querydsl count
JPQLQuery.
-