Package org.datanucleus.store.query
Class JPQLQueryHelper
- java.lang.Object
-
- org.datanucleus.store.query.JPQLQueryHelper
-
public class JPQLQueryHelper extends Object
JPQL query helper class providing key information about the language etc.
-
-
Constructor Summary
Constructors Constructor Description JPQLQueryHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getEntityNameFromJPQLString(String query)
Convenience method to extract the FROM candidate entity name from a JPQL query string.static String
getJPQLForExpression(Expression expr)
Convenience method to return the JPQL single-string query text for the provided expression.static boolean
isKeyword(String name)
Convenience method returning if the supplied name is a keyword for this query language.static boolean
isKeyword(String name, boolean allowRange)
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.
-
-
-
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 checkallowRange
- 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
-
-