Package org.datanucleus.store.query
Class JPQLQueryHelper
java.lang.Object
org.datanucleus.store.query.JPQLQueryHelper
JPQL query helper class providing key information about the language etc.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Convenience method to extract the FROM candidate entity name from a JPQL query string.static String
Convenience method to return the JPQL single-string query text for the provided expression.static boolean
Convenience method returning if the supplied name is a keyword for this query language.static boolean
Convenience method returning if the supplied name is a keyword for this query language (including RANGE).static boolean
isReservedIdentifier
(String name) Convenience method returning if the supplied name is a reserved identifier for this query language.
-
Field Details
-
SINGLE_STRING_KEYWORDS
Keywords used in single-string JPQL. Uppercase variants specified here, but JPQL allows case-insensitive. -
SINGLE_STRING_KEYWORDS_INCLUDING_RANGE
JPQL single-string keywords when allowing RANGE. -
RESERVED_IDENTIFIERS
List of identifier names not allowed by JPQL.
-
-
Constructor Details
-
JPQLQueryHelper
public JPQLQueryHelper()
-
-
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
-
isKeyword
Convenience method returning if the supplied name is a keyword for this query language (including RANGE).- Parameters:
name
- Name to checkallowRange
- Whether to allow RANGE syntax- Returns:
- Whether it is a keyword
-
isReservedIdentifier
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
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
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
-