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
ConstructorsConstructorDescriptionQuerydslRepositorySupport(Class<?> domainClass) Creates a newQuerydslRepositorySupportinstance 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 aJPQLQueryfor the givenEntityPath.protected <T> com.querydsl.core.types.dsl.PathBuilder<T>Returns aPathBuilderfor the configured domain type.protected jakarta.persistence.EntityManagerReturns theEntityManager.protected QuerydslReturns the underlying Querydsl helper instance.voidsetEntityManager(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.voidvalidate()Callback to verify configuration.
-
Constructor Details
-
QuerydslRepositorySupport
Creates a newQuerydslRepositorySupportinstance 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 aJPQLQueryfor 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 aPathBuilderfor the configured domain type.- Type Parameters:
T-- Returns:
- the Querdsl
PathBuilder.
-
getQuerydsl
Returns the underlying Querydsl helper instance.- Returns:
-