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 Summary

    Constructors
    Constructor
    Description
    Creates a new QuerydslRepositorySupport instance for the given domain type.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.querydsl.core.dml.DeleteClause<com.querydsl.jpa.impl.JPADeleteClause>
    delete(com.querydsl.core.types.EntityPath<?> path)
    Returns a fresh DeleteClause.
    protected com.querydsl.jpa.JPQLQuery<Object>
    from(com.querydsl.core.types.EntityPath<?>... paths)
    Returns a fresh JPQLQuery.
    protected <T> com.querydsl.jpa.JPQLQuery<T>
    from(com.querydsl.core.types.EntityPath<T> path)
    Returns a JPQLQuery for the given EntityPath.
    protected <T> com.querydsl.core.types.dsl.PathBuilder<T>
    Returns a PathBuilder for the configured domain type.
    protected jakarta.persistence.EntityManager
    Returns the EntityManager.
    protected Querydsl
    Returns the underlying Querydsl helper instance.
    void
    setEntityManager(jakarta.persistence.EntityManager entityManager)
    Setter to inject EntityManager.
    protected com.querydsl.core.dml.UpdateClause<com.querydsl.jpa.impl.JPAUpdateClause>
    update(com.querydsl.core.types.EntityPath<?> path)
    Returns a fresh UpdateClause.
    void
    Callback to verify configuration.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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(jakarta.persistence.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

      @Nullable protected jakarta.persistence.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

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