Class DelegatingQueryRewriter

java.lang.Object
org.springframework.data.jpa.repository.query.DelegatingQueryRewriter
All Implemented Interfaces:
QueryRewriter

public class DelegatingQueryRewriter extends Object implements QueryRewriter
Delegating QueryRewriter that delegates rewrite calls to a delegate provided by a Supplier.
Since:
3.0
Author:
Mark Paluch
  • Constructor Details

  • Method Details

    • rewrite

      public String rewrite(String query, org.springframework.data.domain.Sort sort)
      Description copied from interface: QueryRewriter
      Rewrite the assembled query with the given Sort.

      WARNING: No checks are performed before the transformed query is passed to the EntityManager.

      Specified by:
      rewrite in interface QueryRewriter
      Parameters:
      query - the assembled query.
      sort - current Sort settings provided by the method, or Sort.unsorted()} if there are none.
      Returns:
      the query to be used with the EntityManager.
    • rewrite

      public String rewrite(String query, org.springframework.data.domain.Pageable pageRequest)
      Description copied from interface: QueryRewriter
      Rewrite the assembled query with the given Pageable.
      Specified by:
      rewrite in interface QueryRewriter
      Parameters:
      query - the assembled query.
      pageRequest - current Pageable settings provided by the method, or Pageable.unpaged() if not paged.
      Returns:
      the query to be used with the EntityManager.