Class QuerydslJpaPredicateExecutor<T>
java.lang.Object
org.springframework.data.jpa.repository.support.QuerydslJpaPredicateExecutor<T>
- All Implemented Interfaces:
JpaRepositoryConfigurationAware
,QuerydslPredicateExecutor<T>
public class QuerydslJpaPredicateExecutor<T>
extends Object
implements QuerydslPredicateExecutor<T>, JpaRepositoryConfigurationAware
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
ConstructorDescriptionQuerydslJpaPredicateExecutor
(JpaEntityInformation<T, ?> entityInformation, jakarta.persistence.EntityManager entityManager, EntityPathResolver resolver, CrudMethodMetadata metadata) Creates a newQuerydslJpaPredicateExecutor
from the given domain class andEntityManager
and uses the givenEntityPathResolver
to translate the domain class into anEntityPath
. -
Method Summary
Modifier and TypeMethodDescriptionlong
count
(com.querydsl.core.types.Predicate predicate) protected com.querydsl.jpa.JPQLQuery<?>
createCountQuery
(com.querydsl.core.types.Predicate... predicate) Creates a newJPQLQuery
count query for the givenPredicate
.protected com.querydsl.jpa.impl.AbstractJPAQuery<?,
?> createQuery
(com.querydsl.core.types.Predicate... predicate) Creates a newJPQLQuery
for the givenPredicate
.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) <S extends T,
R>
RfindBy
(com.querydsl.core.types.Predicate predicate, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction) findOne
(com.querydsl.core.types.Predicate predicate) void
setProjectionFactory
(ProjectionFactory projectionFactory) Configures theProjectionFactory
to be used with the repository.void
Configures theCrudMethodMetadata
to be used with the repository.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.jpa.repository.support.JpaRepositoryConfigurationAware
setEscapeCharacter
-
Constructor Details
-
QuerydslJpaPredicateExecutor
public QuerydslJpaPredicateExecutor(JpaEntityInformation<T, ?> entityInformation, jakarta.persistence.EntityManager entityManager, EntityPathResolver resolver, @Nullable CrudMethodMetadata metadata) Creates a newQuerydslJpaPredicateExecutor
from the given domain class andEntityManager
and uses the givenEntityPathResolver
to 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
-
setRepositoryMethodMetadata
Description copied from interface:JpaRepositoryConfigurationAware
Configures theCrudMethodMetadata
to be used with the repository.- Specified by:
setRepositoryMethodMetadata
in interfaceJpaRepositoryConfigurationAware
- Parameters:
metadata
- must not be null.
-
setProjectionFactory
Description copied from interface:JpaRepositoryConfigurationAware
Configures theProjectionFactory
to be used with the repository.- Specified by:
setProjectionFactory
in interfaceJpaRepositoryConfigurationAware
- Parameters:
projectionFactory
- must not be null.
-
findOne
- Specified by:
findOne
in interfaceQuerydslPredicateExecutor<T>
-
findAll
- Specified by:
findAll
in interfaceQuerydslPredicateExecutor<T>
-
findAll
public List<T> findAll(com.querydsl.core.types.Predicate predicate, com.querydsl.core.types.OrderSpecifier<?>... orders) - Specified by:
findAll
in interfaceQuerydslPredicateExecutor<T>
-
findAll
- Specified by:
findAll
in interfaceQuerydslPredicateExecutor<T>
-
findAll
- Specified by:
findAll
in interfaceQuerydslPredicateExecutor<T>
-
findAll
- Specified by:
findAll
in interfaceQuerydslPredicateExecutor<T>
-
findBy
public <S extends T,R> R findBy(com.querydsl.core.types.Predicate predicate, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction) - Specified by:
findBy
in interfaceQuerydslPredicateExecutor<T>
-
count
public long count(com.querydsl.core.types.Predicate predicate) - Specified by:
count
in interfaceQuerydslPredicateExecutor<T>
-
exists
public boolean exists(com.querydsl.core.types.Predicate predicate) - Specified by:
exists
in interfaceQuerydslPredicateExecutor<T>
-
createQuery
protected com.querydsl.jpa.impl.AbstractJPAQuery<?,?> createQuery(com.querydsl.core.types.Predicate... predicate) Creates a newJPQLQuery
for the givenPredicate
.- Parameters:
predicate
-- Returns:
- the Querydsl
JPQLQuery
.
-
createCountQuery
protected com.querydsl.jpa.JPQLQuery<?> createCountQuery(@Nullable com.querydsl.core.types.Predicate... predicate) Creates a newJPQLQuery
count query for the givenPredicate
.- Parameters:
predicate
- , can be null.- Returns:
- the Querydsl count
JPQLQuery
.
-