Package org.datanucleus.store.query
Class JDOQLQueryHelper
- java.lang.Object
-
- org.datanucleus.store.query.JDOQLQueryHelper
-
public class JDOQLQueryHelper extends java.lang.Object
JDOQL query helper class providing key information about the language etc.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<Expression.Operator,java.lang.String>
DYADIC_OP_JDOQL_MAP
(package private) static java.lang.String[]
SINGLE_STRING_KEYWORDS
Keywords used in single-string JDOQL.(package private) static java.lang.String[]
SINGLE_STRING_KEYWORDS_LOWERCASE
Keywords in lowercase (we avoid calling toLowerCase() multiple times, which is expensive operation)
-
Constructor Summary
Constructors Constructor Description JDOQLQueryHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getCandidateFromJDOQLString(java.lang.String query)
Convenience method to extract the FROM candidate from a JDOQL query string.static java.lang.String
getJDOQLForExpression(Expression expr)
static boolean
isKeyword(java.lang.String name)
Convenience method returning if the supplied name is a keyword for this query language.static boolean
isKeywordExtended(java.lang.String name)
Convenience method returning if the supplied name is a keyword for this query language, allowing the DataNucleus extension keywords (UPDATE, DELETE, SET).static boolean
isValidJavaIdentifierForJDOQL(java.lang.String s)
Utility to check if a name is a valid Java identifier.
-
-
-
Field Detail
-
SINGLE_STRING_KEYWORDS
static final java.lang.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 java.lang.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 java.util.Map<Expression.Operator,java.lang.String> DYADIC_OP_JDOQL_MAP
-
-
Method Detail
-
isKeyword
public static boolean isKeyword(java.lang.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(java.lang.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(java.lang.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 java.lang.String getCandidateFromJDOQLString(java.lang.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 java.lang.String getJDOQLForExpression(Expression expr)
-
-