Interface QueryExtractor

All Known Implementing Classes:
PersistenceProvider

public interface QueryExtractor
Interface to hide different implementations to extract the original JPA query string from a Query.
Author:
Oliver Gierke, Mark Paluch
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether the extractor is able to extract the original query string from a given Query.
    @Nullable String
    Reverse engineers the query string from the Query or a TypedQueryReference object.
    boolean
    Reverse engineers the query native flag from a Query or native query as JPA does not provide access to the underlying query string once a (named) query is constructed.
  • Method Details

    • extractQueryString

      @Nullable String extractQueryString(Object query)
      Reverse engineers the query string from the Query or a TypedQueryReference object. This requires provider specific API as JPA does not provide access to the underlying query string as soon as one has created a Query instance of it.
      Parameters:
      query -
      Returns:
      the query string representing the query or null if resolving is not possible.
    • isNativeQuery

      boolean isNativeQuery(Object query)
      Reverse engineers the query native flag from a Query or native query as JPA does not provide access to the underlying query string once a (named) query is constructed.
      Parameters:
      query -
      Returns:
      true if the query is a native one.
      Since:
      4.0
    • canExtractQuery

      boolean canExtractQuery()
      Returns whether the extractor is able to extract the original query string from a given Query.
      Returns: