EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql.parser
Class EclipseLinkJPQLGrammar2_1

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.parser.AbstractJPQLGrammar
      extended by org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar2_1
All Implemented Interfaces:
JPQLGrammar

public final class EclipseLinkJPQLGrammar2_1
extends AbstractJPQLGrammar

This JPQLGrammar provides support for parsing JPQL queries defined in JSR-337 - Java Persistence 2.0 and the additional support provided by EclipseLink 2.1.

The BNFs of the additional support are the following:
 join ::= join_spec { join_association_path_expression | join_treat_association_path_expression } [AS] identification_variable

 join_treat_association_path_expression ::= TREAT(join_association_path_expression AS entity_type_literal)

 func_expression ::= FUNC(string_literal {, func_item}*)

 func_item ::= new_value

 between_expression ::= scalar_expression [NOT] BETWEEN scalar_expression AND scalar_expression

 in_expression ::= in_expression_expression [NOT] IN { ( in_item {, in_item}* ) | (subquery) | collection_valued_input_parameter }

 in_expression_expression ::= { state_field_path_expression | type_discriminator |
                                single_valued_input_parameter | identification_variable |
                                scalar_expression }

 in_item ::= literal | single_valued_input_parameter | scalar_expression

 scalar_expression ::= arithmetic_expression |
                       ...

 pattern_value ::= scalar_expression | arithmetic_expression

 escape_character ::= scalar_expression

 functions_returning_numerics ::= LENGTH(scalarExpression) |
                                  LOCATE(scalarExpression, scalarExpression[, scalarExpression]) |
                                  MOD(scalarExpression, scalarExpression) |
                                  SQRT(scalarExpression)
                                  func_expression |
                                  ...

 functions_returning_strings ::= CONCAT(scalar_expression {, scalar_expression }+) |
                                 SUBSTRING(scalar_expression, scalar_expression [, scalar_expression]) |
                                 LOWER(scalar_expression) |
                                 UPPER(scalar_expression) |
                                 func_expression |
                                 ...

 orderby_item ::= state_field_path_expression | result_variable | scalar_expression [ ASC | DESC ]

 groupby_item ::= single_valued_path_expression | identification_variable | scalar_expression

 aggregate_expression ::= { AVG | MAX | MIN | SUM | COUNT } ([DISTINCT] scalar_expression)

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Version:
2.4.2
Author:
Pascal Filion
Since:
2.4

Field Summary
static java.lang.String VERSION
          The EclipseLink version, which is 2.1.
 
Constructor Summary
EclipseLinkJPQLGrammar2_1()
          Creates a new EclipseLinkJPQLGrammar2_1.
 
Method Summary
protected  JPQLGrammar buildBaseGrammar()
          Creates the base JPQLGrammar this one extends, if one exists.
static void extend(AbstractJPQLGrammar jpqlGrammar)
          Extends the given JPQLGrammar with the information of this one without instantiating the base JPQLGrammar.
 JPAVersion getJPAVersion()
          Returns the JPAVersion of the Java Persistence supported by this grammar.
 java.lang.String getProviderVersion()
          Returns the version of the persistence provider.
protected  void initializeBNFs()
          Registers the JPQL query BNFs defining the JPQL grammar.
protected  void initializeExpressionFactories()
          Registers the ExpressionFactories required to properly parse JPQL queries.
protected  void initializeIdentifiers()
          Registers the JPQL identifiers support by this IJPQLExtension.
static JPQLGrammar instance()
          Returns the singleton instance of this class.
 java.lang.String toString()
          
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AbstractJPQLGrammar
addChildBNF, addChildFactory, addIdentifier, addIdentifiers, buildExpressionRegistry, getBaseGrammar, getExpressionRegistry, initialize, registerBNF, registerFactory, registerIdentifierRole, registerIdentifierVersion, setFallbackBNFId, setFallbackExpressionFactoryId, setHandleSubExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
The EclipseLink version, which is 2.1.

See Also:
Constant Field Values
Constructor Detail

EclipseLinkJPQLGrammar2_1

public EclipseLinkJPQLGrammar2_1()
Creates a new EclipseLinkJPQLGrammar2_1.

Method Detail

extend

public static void extend(AbstractJPQLGrammar jpqlGrammar)
Extends the given JPQLGrammar with the information of this one without instantiating the base JPQLGrammar.

Parameters:
jpqlGrammar - The JPQLGrammar to extend with the content of this one without instantiating the base JPQLGrammar

instance

public static JPQLGrammar instance()
Returns the singleton instance of this class.

Returns:
The EclipseLinkJPQLGrammar2_1

buildBaseGrammar

protected JPQLGrammar buildBaseGrammar()
Creates the base JPQLGrammar this one extends, if one exists.

IMPORTANT: The singleton instance of any JPQLGrammar (for example JPQLGrammar1_0.instance() cannot be used, the API does not support extending it, a new instance has to be created.

Specified by:
buildBaseGrammar in class AbstractJPQLGrammar
Returns:
The base JPQLGrammar or null if there is no base grammar

getJPAVersion

public JPAVersion getJPAVersion()
Returns the JPAVersion of the Java Persistence supported by this grammar.

Returns:
The JPA version supported by this grammar

getProviderVersion

public java.lang.String getProviderVersion()
Returns the version of the persistence provider.

Returns:
The version of the persistence provider, if one is extending the default JPQL grammar defined in the Java Persistence specification, otherwise returns an empty string

initializeBNFs

protected void initializeBNFs()
Registers the JPQL query BNFs defining the JPQL grammar.

Specified by:
initializeBNFs in class AbstractJPQLGrammar

initializeExpressionFactories

protected void initializeExpressionFactories()
Registers the ExpressionFactories required to properly parse JPQL queries. An ExpressionFactory is responsible to create an Expression object that represents a portion of the JPQL query.

Specified by:
initializeExpressionFactories in class AbstractJPQLGrammar

initializeIdentifiers

protected void initializeIdentifiers()
Registers the JPQL identifiers support by this IJPQLExtension. The registration involves registering the JPAVersion and the IdentifierRole.

Specified by:
initializeIdentifiers in class AbstractJPQLGrammar

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference