Class QuerydslRepositorySupport

java.lang.Object
org.springframework.data.jpa.repository.support.QuerydslRepositorySupport

@Repository public abstract class QuerydslRepositorySupport extends Object
Base class for implementing repositories using Querydsl library.
Author:
Oliver Gierke, Mark Paluch
  • Constructor Details

    • QuerydslRepositorySupport

      public QuerydslRepositorySupport(Class<?> domainClass)
      Creates a new QuerydslRepositorySupport instance for the given domain type.
      Parameters:
      domainClass - must not be null.
  • Method Details

    • setEntityManager

      @Autowired public void setEntityManager(EntityManager entityManager)
      Setter to inject EntityManager.
      Parameters:
      entityManager - must not be null.
    • validate

      @PostConstruct public void validate()
      Callback to verify configuration. Used by containers.
    • getEntityManager

      protected @Nullable EntityManager getEntityManager()
      Returns the EntityManager.
      Returns:
      the entityManager
    • from

      protected com.querydsl.jpa.JPQLQuery<Object> from(com.querydsl.core.types.EntityPath<?>... paths)
      Returns a fresh JPQLQuery.
      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 a JPQLQuery for the given EntityPath.
      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 fresh DeleteClause.
      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 fresh UpdateClause.
      Parameters:
      path -
      Returns:
      the Querydsl UpdateClause.
    • getBuilder

      protected <T> com.querydsl.core.types.dsl.PathBuilder<T> getBuilder()
      Returns a PathBuilder for the configured domain type.
      Type Parameters:
      T -
      Returns:
      the Querdsl PathBuilder.
    • getQuerydsl

      protected @Nullable Querydsl getQuerydsl()
      Returns the underlying Querydsl helper instance.
      Returns: