Class JPQLQueryHelper


  • public class JPQLQueryHelper
    extends Object
    JPQL query helper class providing key information about the language etc.
    • Constructor Detail

      • JPQLQueryHelper

        public JPQLQueryHelper()
    • Method Detail

      • isKeyword

        public static boolean isKeyword​(String name)
        Convenience method returning if the supplied name is a keyword for this query language.
        Parameters:
        name - Name to check
        Returns:
        Whether it is a keyword
      • isKeyword

        public static boolean isKeyword​(String name,
                                        boolean allowRange)
        Convenience method returning if the supplied name is a keyword for this query language (including RANGE).
        Parameters:
        name - Name to check
        allowRange - Whether to allow RANGE syntax
        Returns:
        Whether it is a keyword
      • isReservedIdentifier

        public static boolean isReservedIdentifier​(String name)
        Convenience method returning if the supplied name is a reserved identifier for this query language.
        Parameters:
        name - Name to check
        Returns:
        Whether it is a reserved identifier
      • getEntityNameFromJPQLString

        public static String getEntityNameFromJPQLString​(String query)
        Convenience method to extract the FROM candidate entity name from a JPQL query string.
        Parameters:
        query - The query string
        Returns:
        The candidate entity name
      • getJPQLForExpression

        public static String getJPQLForExpression​(Expression expr)
        Convenience method to return the JPQL single-string query text for the provided expression.
        Parameters:
        expr - The expression
        Returns:
        The JPQL single-string text that equates to this expression