Class DefaultGrammarValidator
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
-
- org.eclipse.persistence.jpa.jpql.AbstractValidator
-
- org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator
-
- org.eclipse.persistence.jpa.jpql.tools.DefaultGrammarValidator
-
- All Implemented Interfaces:
ExpressionVisitor
public class DefaultGrammarValidator extends AbstractGrammarValidator
This validator is responsible to validate a JPQL query grammatically purely based on the JPA specification document.- Version:
- 2.5
- See Also:
- JSR 220: Enterprise JavaBeans 3.0,
JSR 317: Java Persistence 2.0,
JSR 338: Java Persistence 2.1,
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.
- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator
AbstractGrammarValidator.AbstractCollectionValidator, AbstractGrammarValidator.AbstractDoubleEncapsulatedExpressionHelper<T extends AbstractDoubleEncapsulatedExpression>, AbstractGrammarValidator.AbstractEncapsulatedExpressionHelper<T extends AbstractEncapsulatedExpression>, AbstractGrammarValidator.AbstractSingleEncapsulatedExpressionHelper<T extends AbstractSingleEncapsulatedExpression>, AbstractGrammarValidator.AbstractTripleEncapsulatedExpressionHelper<T extends AbstractTripleEncapsulatedExpression>, AbstractGrammarValidator.CollectionExpressionVisitor, AbstractGrammarValidator.CollectionSeparatedByCommaValidator, AbstractGrammarValidator.CollectionSeparatedBySpaceValidator, AbstractGrammarValidator.ComparisonExpressionVisitor, AbstractGrammarValidator.DateTimeVisitor, AbstractGrammarValidator.NullExpressionVisitor
-
Nested classes/interfaces inherited from class org.eclipse.persistence.jpa.jpql.AbstractValidator
AbstractValidator.BypassChildCollectionExpressionVisitor, AbstractValidator.BypassParentSubExpressionVisitor, AbstractValidator.ChildrenCollectorVisitor, AbstractValidator.JPQLQueryBNFValidator, AbstractValidator.NestedArrayVisitor, AbstractValidator.OwningClauseVisitor, AbstractValidator.OwningStatementVisitor, AbstractValidator.SubqueryVisitor
-
-
Constructor Summary
Constructors Constructor Description DefaultGrammarValidator(JPQLGrammar jpqlGrammar)
Creates a newDefaultGrammarValidator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LiteralVisitor
buildLiteralVisitor()
Creates the visitor that can retrieve some information about various literal.protected AbstractValidator.OwningClauseVisitor
buildOwningClauseVisitor()
Creates the visitor that traverses the parent hierarchy of anyExpression
and stops at the firstExpression
that is a clause.protected boolean
isJoinFetchIdentifiable()
Determines whether aJOIN FETCH
expression can be identified by with an identification variable or not.protected boolean
isSubqueryAllowedAnywhere()
Determines whether a subquery can be used in any clause of the top-level query.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator
absExpressionHelper, allOrAnyExpressionHelper, avgFunctionHelper, buildAbsExpressionHelper, buildAllOrAnyExpressionHelper, buildAvgFunctionHelper, buildCoalesceExpressionHelper, buildCollectionExpressionVisitor, buildConcatExpressionHelper, buildCountFunctionHelper, buildDateTimeVisitor, buildEntryExpressionHelper, buildExistsExpressionHelper, buildFunctionExpressionHelper, buildIndexExpressionHelper, buildKeyExpressionHelper, buildLengthExpressionHelper, buildLocateExpressionHelper, buildLowerExpressionHelper, buildMaxFunctionHelper, buildMinFunctionHelper, buildModExpressionHelper, buildNullExpressionVisitor, buildNullIfExpressionHelper, buildObjectExpressionHelper, buildSizeExpressionHelper, buildSqrtExpressionHelper, buildSubstringExpressionHelper, buildSumFunctionHelper, buildTrimExpressionHelper, buildTypeExpressionHelper, buildUpperExpressionHelper, buildValueExpressionHelper, coalesceExpressionHelper, collectionSeparatedByCommaValidator, collectionSeparatedBySpaceValidator, comparisonExpressionVisitor, concatExpressionHelper, countFunctionHelper, dispose, entryExpressionHelper, existsExpressionHelper, functionExpressionHelper, getCollectionExpression, getCollectionExpressionVisitor, getDateTimeVisitor, getGrammar, getHelper, indexExpressionHelper, initialize, isChildOfComparisonExpession, isCollectionExpression, isDateTimeConstant, isInputParameterInValidLocation, isJPA1_0, isJPA2_0, isJPA2_1, isMultipleSubquerySelectItemsAllowed, isNewerThan, isNewerThanOrEqual, isNumericLiteral, isOlderThan, isOlderThanOrEqual, isOwnedByConditionalClause, isOwnedByFromClause, isOwnedBySubFromClause, isValidJavaIdentifier, keyExpressionHelper, lengthExpressionHelper, locateExpressionHelper, lowerExpressionHelper, maxFunctionHelper, minFunctionHelper, modExpressionHelper, nullIfExpressionHelper, objectExpressionHelper, position, registerHelper, sizeExpressionHelper, sqrtExpressionHelper, substringExpressionHelper, sumFunctionHelper, trimExpressionHelper, typeExpressionHelper, upperExpressionHelper, validateAbstractConditionalClause, validateAbstractDoubleEncapsulatedExpression, validateAbstractFromClause, validateAbstractSelectClause, validateAbstractSelectStatement, validateAbstractSingleEncapsulatedExpression, validateAbstractTripleEncapsulatedExpression, validateAggregateFunctionLocation, validateArithmeticExpression, validateCollectionSeparatedByComma, validateCollectionSeparatedBySpace, validateCompoundExpression, validateIdentificationVariableDeclaration, validateIdentifier, validateInputParameters, validateJoins, validateLikeExpressionEscapeCharacter, validateLogicalExpression, validateOwningClause, validatePathExpression, validateSimpleSelectStatement, valueExpressionHelper, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.AbstractValidator
addProblem, addProblem, addProblem, addProblem, buildChildrenCollector, buildNestedArrayVisitor, buildOwningStatementVisitor, buildProblem, buildSubqueryVisitor, getBypassChildCollectionExpressionVisitor, getBypassParentSubExpressionVisitor, getChildren, getChildrenCollectorVisitor, getExpressionRegistry, getExpressionValidator, getJPAVersion, getJPQLQueryBNFValidator, getJPQLQueryBNFValidator, getLiteralVisitor, getNestedArrayVisitor, getOwningClauseVisitor, getOwningStatementVisitor, getProvider, getProviderVersion, getQueryBNF, getSubqueryVisitor, isNestedArray, isSubquery, isValid, isValid, isValid, isValidWithChildCollectionBypass, isWithinSubquery, isWithinTopLevelQuery, length, literal, nestedArraySize, position, problemsSize, setProblems, visit
-
-
-
-
Constructor Detail
-
DefaultGrammarValidator
public DefaultGrammarValidator(JPQLGrammar jpqlGrammar)
Creates a newDefaultGrammarValidator
.- Parameters:
jpqlGrammar
- TheJPQLGrammar
that defines how the JPQL query was parsed
-
-
Method Detail
-
buildLiteralVisitor
protected LiteralVisitor buildLiteralVisitor()
Creates the visitor that can retrieve some information about various literal.- Specified by:
buildLiteralVisitor
in classAbstractValidator
- Returns:
- A new
LiteralVisitor
-
buildOwningClauseVisitor
protected AbstractValidator.OwningClauseVisitor buildOwningClauseVisitor()
Creates the visitor that traverses the parent hierarchy of anyExpression
and stops at the firstExpression
that is a clause.- Specified by:
buildOwningClauseVisitor
in classAbstractValidator
- Returns:
- A new
AbstractValidator.OwningClauseVisitor
-
isJoinFetchIdentifiable
protected boolean isJoinFetchIdentifiable()
Determines whether aJOIN FETCH
expression can be identified by with an identification variable or not.- Specified by:
isJoinFetchIdentifiable
in classAbstractGrammarValidator
- Returns:
true
if the expression can have an identification variable;false
otherwise
-
isSubqueryAllowedAnywhere
protected boolean isSubqueryAllowedAnywhere()
Determines whether a subquery can be used in any clause of the top-level query.- Specified by:
isSubqueryAllowedAnywhere
in classAbstractGrammarValidator
- Returns:
true
if a subquery can be defined in any clause;false
if it can only be used within theWHERE
andHAVING
defined by the JPA 1.0 and 2.0 specification document
-
-