Top Description Constructors Methods
org.eclipse.persistence.jpa.jpql.tools

public Class DefaultGrammarValidator

extends AbstractGrammarValidator
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator, .JPAVersion, .LiteralVisitor, org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar

This validator is responsible to validate a JPQL query grammatically purely based on the JPA specification document.
Author
Pascal Filion
Since
2.4
Version
2.5
See Also
JSR 220: Enterprise JavaBeans 3.0, JSR 317: Java Persistence 2.0, JSR 338: Java Persistence 2.1, <p> 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.

Constructor Summary

AccessConstructor and Description
public
DefaultGrammarValidator(JPQLGrammar
The JPQLGrammar that defines how the JPQL query was parsed
jpqlGrammar
)

Creates a new DefaultGrammarValidator.

Method Summary

Modifier and TypeMethod and Description
protected LiteralVisitor
buildLiteralVisitor()

Implements abstract org.eclipse.persistence.jpa.jpql.AbstractValidator.buildLiteralVisitor.

Creates the visitor that can retrieve some information about various literal.
protected AbstractValidator.OwningClauseVisitor
buildOwningClauseVisitor()

Implements abstract org.eclipse.persistence.jpa.jpql.AbstractValidator.buildOwningClauseVisitor.

Creates the visitor that traverses the parent hierarchy of any Expression and stops at the first Expression that is a clause.
protected boolean
isJoinFetchIdentifiable()

Implements abstract org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator.isJoinFetchIdentifiable.

Determines whether a JOIN FETCH expression can be identified by with an identification variable or not.
protected boolean
isSubqueryAllowedAnywhere()

Implements abstract org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator.isSubqueryAllowedAnywhere.

Determines whether a subquery can be used in any clause of the top-level query.
Inherited from org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator:
absExpressionHelperallOrAnyExpressionHelperavgFunctionHelperbuildAbsExpressionHelperbuildAllOrAnyExpressionHelperbuildAvgFunctionHelperbuildCoalesceExpressionHelperbuildCollectionExpressionVisitorbuildConcatExpressionHelperbuildCountFunctionHelperbuildDateTimeVisitorbuildEntryExpressionHelperbuildExistsExpressionHelperbuildFunctionExpressionHelperbuildIndexExpressionHelperbuildKeyExpressionHelperbuildLengthExpressionHelperbuildLocateExpressionHelperbuildLowerExpressionHelperbuildMaxFunctionHelperbuildMinFunctionHelperbuildModExpressionHelperbuildNullExpressionVisitorbuildNullIfExpressionHelperbuildObjectExpressionHelperbuildSizeExpressionHelperbuildSqrtExpressionHelperbuildSubstringExpressionHelperbuildSumFunctionHelperbuildTrimExpressionHelperbuildTypeExpressionHelperbuildUpperExpressionHelperbuildValueExpressionHelpercoalesceExpressionHelpercollectionSeparatedByCommaValidatorcollectionSeparatedBySpaceValidatorcomparisonExpressionVisitorconcatExpressionHelpercountFunctionHelperdisposeentryExpressionHelperexistsExpressionHelperfunctionExpressionHelpergetCollectionExpressiongetCollectionExpressionVisitorgetDateTimeVisitorgetGrammargetHelperindexExpressionHelperinitializeisChildOfComparisonExpessionisCollectionExpressionisDateTimeConstantisInputParameterInValidLocationisJPA1_0isJPA2_0isJPA2_1isMultipleSubquerySelectItemsAllowedisNewerThanisNewerThanOrEqualisNumericLiteralisOlderThanisOlderThanOrEqualisOwnedByConditionalClauseisOwnedByFromClauseisOwnedBySubFromClauseisValidJavaIdentifierkeyExpressionHelperlengthExpressionHelperlocateExpressionHelperlowerExpressionHelpermaxFunctionHelperminFunctionHelpermodExpressionHelpernullIfExpressionHelperobjectExpressionHelperpositionregisterHelpersizeExpressionHelpersqrtExpressionHelpersubstringExpressionHelpersumFunctionHelpertrimExpressionHelpertypeExpressionHelperupperExpressionHelpervalidateAbstractConditionalClausevalidateAbstractDoubleEncapsulatedExpressionvalidateAbstractFromClausevalidateAbstractSelectClausevalidateAbstractSelectStatementvalidateAbstractSingleEncapsulatedExpressionvalidateAbstractTripleEncapsulatedExpressionvalidateAggregateFunctionLocationvalidateArithmeticExpressionvalidateCollectionSeparatedByCommavalidateCollectionSeparatedBySpacevalidateCompoundExpressionvalidateIdentificationVariableDeclarationvalidateIdentifiervalidateInputParametersvalidateJoinsvalidateLikeExpressionEscapeCharactervalidateLogicalExpressionvalidateOwningClausevalidatePathExpressionvalidateSimpleSelectStatementvalueExpressionHelpervisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisit

Constructor Detail

DefaultGrammarValidatorback to summary
public DefaultGrammarValidator(JPQLGrammar jpqlGrammar)

Creates a new DefaultGrammarValidator.

Parameters
jpqlGrammar:JPQLGrammar

The JPQLGrammar that defines how the JPQL query was parsed

Method Detail

buildLiteralVisitorback to summary
protected LiteralVisitor buildLiteralVisitor()

Implements abstract org.eclipse.persistence.jpa.jpql.AbstractValidator.buildLiteralVisitor.

Doc from org.eclipse.persistence.jpa.jpql.AbstractValidator.buildLiteralVisitor.

Creates the visitor that can retrieve some information about various literal.

Returns:LiteralVisitor

A new LiteralVisitor

Annotations
@Override
buildOwningClauseVisitorback to summary
protected AbstractValidator.OwningClauseVisitor buildOwningClauseVisitor()

Implements abstract org.eclipse.persistence.jpa.jpql.AbstractValidator.buildOwningClauseVisitor.

Doc from org.eclipse.persistence.jpa.jpql.AbstractValidator.buildOwningClauseVisitor.

Creates the visitor that traverses the parent hierarchy of any Expression and stops at the first Expression that is a clause.

Returns:AbstractValidator.OwningClauseVisitor

A new OwningClauseVisitor

Annotations
@Override
isJoinFetchIdentifiableback to summary
protected boolean isJoinFetchIdentifiable()

Implements abstract org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator.isJoinFetchIdentifiable.

Doc from org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator.isJoinFetchIdentifiable.

Determines whether a JOIN FETCH expression can be identified by with an identification variable or not.

Returns:boolean

true if the expression can have an identification variable; false otherwise

Annotations
@Override
isSubqueryAllowedAnywhereback to summary
protected boolean isSubqueryAllowedAnywhere()

Implements abstract org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator.isSubqueryAllowedAnywhere.

Doc from org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator.isSubqueryAllowedAnywhere.

Determines whether a subquery can be used in any clause of the top-level query.

Returns:boolean

true if a subquery can be defined in any clause; false if it can only be used within the WHERE and HAVING defined by the JPA 1.0 and 2.0 specification document

Annotations
@Override