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

public class Querydsl extends Object
Helper instance to ease access to Querydsl JPA query API.
Author:
Oliver Gierke, Thomas Darimont, Mark Paluch, Christoph Strobl, Marcus Voltolim, Donghun Shin
  • Constructor Summary

    Constructors
    Constructor
    Description
    Querydsl(jakarta.persistence.EntityManager em, com.querydsl.core.types.dsl.PathBuilder<?> builder)
    Creates a new Querydsl for the given EntityManager and PathBuilder.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> com.querydsl.jpa.JPQLQuery<T>
    applyPagination(Pageable pageable, com.querydsl.jpa.JPQLQuery<T> query)
    Applies the given Pageable to the given JPQLQuery.
    <T> com.querydsl.jpa.JPQLQuery<T>
    applySorting(Sort sort, com.querydsl.jpa.JPQLQuery<T> query)
    Applies sorting to the given JPQLQuery.
    <T> com.querydsl.jpa.impl.AbstractJPAQuery<T,com.querydsl.jpa.impl.JPAQuery<T>>
    Creates the JPQLQuery instance based on the configured EntityManager.
    com.querydsl.jpa.impl.AbstractJPAQuery<Object,com.querydsl.jpa.impl.JPAQuery<Object>>
    createQuery(com.querydsl.core.types.EntityPath<?>... paths)
    Creates the JPQLQuery instance based on the configured EntityManager.
    com.querydsl.jpa.JPQLTemplates
    Obtains the JPQLTemplates for the configured EntityManager.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Querydsl

      public Querydsl(jakarta.persistence.EntityManager em, com.querydsl.core.types.dsl.PathBuilder<?> builder)
      Creates a new Querydsl for the given EntityManager and PathBuilder.
      Parameters:
      em - must not be null.
      builder - must not be null.
  • Method Details

    • createQuery

      public <T> com.querydsl.jpa.impl.AbstractJPAQuery<T,com.querydsl.jpa.impl.JPAQuery<T>> createQuery()
      Creates the JPQLQuery instance based on the configured EntityManager.
    • getTemplates

      @Nullable public com.querydsl.jpa.JPQLTemplates getTemplates()
      Obtains the JPQLTemplates for the configured EntityManager. Can return null to use the default templates.
      Returns:
      the JPQLTemplates for the configured EntityManager or null to use the default.
      Since:
      3.5
    • createQuery

      public com.querydsl.jpa.impl.AbstractJPAQuery<Object,com.querydsl.jpa.impl.JPAQuery<Object>> createQuery(com.querydsl.core.types.EntityPath<?>... paths)
      Creates the JPQLQuery instance based on the configured EntityManager.
      Parameters:
      paths - must not be null.
    • applyPagination

      public <T> com.querydsl.jpa.JPQLQuery<T> applyPagination(Pageable pageable, com.querydsl.jpa.JPQLQuery<T> query)
      Applies the given Pageable to the given JPQLQuery.
      Parameters:
      pageable - must not be null.
      query - must not be null.
      Returns:
      the Querydsl JPQLQuery.
    • applySorting

      public <T> com.querydsl.jpa.JPQLQuery<T> applySorting(Sort sort, com.querydsl.jpa.JPQLQuery<T> query)
      Applies sorting to the given JPQLQuery.
      Parameters:
      sort - must not be null.
      query - must not be null.
      Returns:
      the Querydsl JPQLQuery