Class QuerydslRepositorySupport
java.lang.Object
org.springframework.data.jpa.repository.support.QuerydslRepositorySupport
Base class for implementing repositories using Querydsl library.
- Author:
- Oliver Gierke, Mark Paluch
-
Constructor Summary
ConstructorDescriptionQuerydslRepositorySupport
(Class<?> domainClass) Creates a newQuerydslRepositorySupport
instance for the given domain type. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.querydsl.core.dml.DeleteClause<com.querydsl.jpa.impl.JPADeleteClause>
delete
(com.querydsl.core.types.EntityPath<?> path) Returns a freshDeleteClause
.protected com.querydsl.jpa.JPQLQuery<Object>
from
(com.querydsl.core.types.EntityPath<?>... paths) Returns a freshJPQLQuery
.protected <T> com.querydsl.jpa.JPQLQuery<T>
from
(com.querydsl.core.types.EntityPath<T> path) Returns aJPQLQuery
for the givenEntityPath
.protected <T> com.querydsl.core.types.dsl.PathBuilder<T>
Returns aPathBuilder
for the configured domain type.protected jakarta.persistence.EntityManager
Returns theEntityManager
.protected Querydsl
Returns the underlying Querydsl helper instance.void
setEntityManager
(jakarta.persistence.EntityManager entityManager) Setter to injectEntityManager
.protected com.querydsl.core.dml.UpdateClause<com.querydsl.jpa.impl.JPAUpdateClause>
update
(com.querydsl.core.types.EntityPath<?> path) Returns a freshUpdateClause
.void
validate()
Callback to verify configuration.
-
Constructor Details
-
QuerydslRepositorySupport
Creates a newQuerydslRepositorySupport
instance for the given domain type.- Parameters:
domainClass
- must not be null.
-
-
Method Details
-
setEntityManager
Setter to injectEntityManager
.- Parameters:
entityManager
- must not be null.
-
validate
@PostConstruct public void validate()Callback to verify configuration. Used by containers. -
getEntityManager
Returns theEntityManager
.- Returns:
- the entityManager
-
from
Returns a freshJPQLQuery
.- Parameters:
paths
- must not be null.- Returns:
- the Querydsl
JPQLQuery
.
-
from
protected <T> com.querydsl.jpa.JPQLQuery<T> from(com.querydsl.core.types.EntityPath<T> path) Returns aJPQLQuery
for the givenEntityPath
.- Parameters:
path
- must not be null.- Returns:
-
delete
protected com.querydsl.core.dml.DeleteClause<com.querydsl.jpa.impl.JPADeleteClause> delete(com.querydsl.core.types.EntityPath<?> path) Returns a freshDeleteClause
.- Parameters:
path
-- Returns:
- the Querydsl
DeleteClause
.
-
update
protected com.querydsl.core.dml.UpdateClause<com.querydsl.jpa.impl.JPAUpdateClause> update(com.querydsl.core.types.EntityPath<?> path) Returns a freshUpdateClause
.- Parameters:
path
-- Returns:
- the Querydsl
UpdateClause
.
-
getBuilder
protected <T> com.querydsl.core.types.dsl.PathBuilder<T> getBuilder()Returns aPathBuilder
for the configured domain type.- Type Parameters:
T
-- Returns:
- the Querdsl
PathBuilder
.
-
getQuerydsl
Returns the underlying Querydsl helper instance.- Returns:
-