Package org.datanucleus.store.query
Class JDOQLQueryHelper
java.lang.Object
org.datanucleus.store.query.JDOQLQueryHelper
JDOQL query helper class providing key information about the language etc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map
<Expression.Operator, String> (package private) static final String[]
Keywords used in single-string JDOQL.(package private) static final String[]
Keywords in lowercase (we avoid calling toLowerCase() multiple times, which is expensive operation) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Convenience method to extract the FROM candidate from a JDOQL query string.static String
static boolean
Convenience method returning if the supplied name is a keyword for this query language.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).static boolean
Utility to check if a name is a valid Java identifier.
-
Field Details
-
SINGLE_STRING_KEYWORDS
Keywords used in single-string JDOQL. Uppercase variants specified here, but we allow the lowercase form. -
SINGLE_STRING_KEYWORDS_LOWERCASE
Keywords in lowercase (we avoid calling toLowerCase() multiple times, which is expensive operation) -
DYADIC_OP_JDOQL_MAP
-
-
Constructor Details
-
JDOQLQueryHelper
public JDOQLQueryHelper()
-
-
Method Details
-
isKeyword
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
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
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
Convenience method to extract the FROM candidate from a JDOQL query string.- Parameters:
query
- The query string- Returns:
- The from candidate
-
getJDOQLForExpression
-