Class JDOQLQueryHelper

java.lang.Object
org.datanucleus.store.query.JDOQLQueryHelper

public class JDOQLQueryHelper extends Object
JDOQL query helper class providing key information about the language etc.
  • Field Details

    • SINGLE_STRING_KEYWORDS

      static final String[] SINGLE_STRING_KEYWORDS
      Keywords used in single-string JDOQL. Uppercase variants specified here, but we allow the lowercase form.
    • SINGLE_STRING_KEYWORDS_LOWERCASE

      static final String[] SINGLE_STRING_KEYWORDS_LOWERCASE
      Keywords in lowercase (we avoid calling toLowerCase() multiple times, which is expensive operation)
    • DYADIC_OP_JDOQL_MAP

      private static final Map<Expression.Operator,String> DYADIC_OP_JDOQL_MAP
  • Constructor Details

    • JDOQLQueryHelper

      public JDOQLQueryHelper()
  • Method Details

    • 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
    • isKeywordExtended

      public static boolean isKeywordExtended(String name)
      Convenience method returning if the supplied name is a keyword for this query language, allowing the DataNucleus extension keywords (UPDATE, DELETE, SET).
      Parameters:
      name - Name to check
      Returns:
      Whether it is a keyword
    • isValidJavaIdentifierForJDOQL

      public static boolean isValidJavaIdentifierForJDOQL(String s)
      Utility to check if a name is a valid Java identifier. Used by JDOQL in validating the names of parameters/variables.
      Parameters:
      s - The name
      Returns:
      Whether it is a valid identifier in Java.
    • getCandidateFromJDOQLString

      public static String getCandidateFromJDOQLString(String query)
      Convenience method to extract the FROM candidate from a JDOQL query string.
      Parameters:
      query - The query string
      Returns:
      The from candidate
    • getJDOQLForExpression

      public static String getJDOQLForExpression(Expression expr)