EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql
Class AbstractSemanticValidator

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
      extended by org.eclipse.persistence.jpa.jpql.AbstractValidator
          extended by org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator
All Implemented Interfaces:
ExpressionVisitor
Direct Known Subclasses:
DefaultSemanticValidator, EclipseLinkSemanticValidator

public abstract class AbstractSemanticValidator
extends AbstractValidator

The base validator responsible to gather the problems found in a JPQL query by validating the content to make sure it is semantically valid, i.e. based on the information contained in the JPA application. The grammar is not validated by this visitor.

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
See Also:
AbstractGrammarValidator
Author:
Pascal Filion
Since:
2.4

Nested Class Summary
protected  class AbstractSemanticValidator.ComparingEntityTypeLiteralVisitor
           
protected  class AbstractSemanticValidator.ComparisonExpressionVisitor
          This visitor compares the left and right expressions of a comparison expression and gathers information about those expressions if they are an identification variable or a path expression.
protected  class AbstractSemanticValidator.FirstDeclarationVisitor
           
protected static class AbstractSemanticValidator.PathType
          This enumeration allows validateStateFieldPathExpression( StateFieldPathExpression, PathType) to validate the type of the mapping and to make sure it is allowed based on its location.
protected  class AbstractSemanticValidator.SubqueryFirstDeclarationVisitor
           
protected  class AbstractSemanticValidator.TopLevelFirstDeclarationVisitor
           
 
Nested classes/interfaces inherited from class org.eclipse.persistence.jpa.jpql.AbstractValidator
AbstractValidator.BypassChildCollectionExpressionVisitor, AbstractValidator.BypassParentSubExpressionVisitor, AbstractValidator.ChildrenCollectorVisitor, AbstractValidator.JPQLQueryBNFValidator, AbstractValidator.OwningClauseVisitor, AbstractValidator.OwningStatementVisitor, AbstractValidator.SubqueryVisitor
 
Field Summary
protected  DefaultSemanticValidator.CollectionValuedPathExpressionVisitor collectionValuedPathExpressionVisitor
          This visitor is responsible to retrieve the visited Expression if it is a CollectionValuedPathExpression.
protected  SemanticValidatorHelper helper
          The given helper allows this validator to access the JPA artifacts without using Hermes SPI.
protected  boolean registerIdentificationVariable
          This flag is used to register the IdentificationVariables that are used throughout the query (top-level query and subqueries), except the identification variables defining an abstract schema name or a collection-valued path expression.
protected  DefaultSemanticValidator.StateFieldPathExpressionVisitor stateFieldPathExpressionVisitor
          This visitor is responsible to retrieve the visited Expression if it is a StateFieldPathExpression.
protected  java.util.List<IdentificationVariable> usedIdentificationVariables
          The IdentificationVariables that are used throughout the query (top-level query and subqueries), except the identification variables defining an abstract schema name or a collection-valued path expression.
protected  DefaultSemanticValidator.VirtualIdentificationVariableFinder virtualIdentificationVariableFinder
          This finder is responsible to retrieve the virtual identification variable from the UPDATE range declaration since it is optional.
 
Constructor Summary
protected AbstractSemanticValidator(SemanticValidatorHelper helper)
          Creates a new AbstractSemanticValidator.
 
Method Summary
protected  AbstractSemanticValidator.ComparingEntityTypeLiteralVisitor buildComparingEntityTypeLiteralVisitor()
           
protected  AbstractSemanticValidator.SubqueryFirstDeclarationVisitor buildSubqueryFirstDeclarationVisitor()
           
protected  AbstractSemanticValidator.TopLevelFirstDeclarationVisitor buildTopLevelFirstDeclarationVisitor()
           
 void dispose()
          Disposes this visitor.
protected  IdentificationVariable findVirtualIdentificationVariable(AbstractSchemaName expression)
          Returns the IdentificationVariable that defines the identification variable for either a DELETE or an UPDATE query.
protected  CollectionValuedPathExpression getCollectionValuedPathExpression(Expression expression)
           
protected  DefaultSemanticValidator.CollectionValuedPathExpressionVisitor getCollectionValuedPathExpressionVisitor()
           
protected  AbstractSemanticValidator.ComparingEntityTypeLiteralVisitor getComparingEntityTypeLiteralVisitor()
           
protected  AbstractSemanticValidator.ComparisonExpressionVisitor getComparisonExpressionVisitor()
           
protected  JPQLGrammar getGrammar()
          Returns the JPQLGrammar that defines how the JPQL query was parsed.
protected  StateFieldPathExpression getStateFieldPathExpression(Expression expression)
           
protected  DefaultSemanticValidator.StateFieldPathExpressionVisitor getStateFieldPathExpressionVisitor()
           
protected  DefaultSemanticValidator.VirtualIdentificationVariableFinder getVirtualIdentificationVariableFinder()
          Returns the visitor that can find the IdentificationVariable of the RangeVariableDeclaration.
protected  void initialize()
          Initializes this validator.
protected  boolean isComparingEntityTypeLiteral(IdentificationVariable expression)
          Determines whether the given identification variable is used in a comparison expression: "expression = LargeProject".
protected  boolean isIdentificationVariableDeclaredAfter(java.lang.String variableName, int variableNameIndex, int joinIndex, java.util.List<JPQLQueryDeclaration> declarations)
           
protected  boolean isIdentificationVariableValidInComparison(IdentificationVariable expression)
          Determines whether an identification variable can be used in a comparison expression when the operator is either '<', '<=', '>', '>='.
protected  boolean isOrderComparison(ComparisonExpression expression)
          Determines whether the given ComparisonExpression compares two expression using one of the following operators: '<', '<=', '>', '>='.
protected  boolean isValid(int result, int index)
          Determines whether the expression at the given index is valid or not.
protected abstract  AbstractSemanticValidator.PathType selectClausePathExpressionPathType()
          Returns the type of path expression that is allowed in the SELECT clause.
protected  AbstractSemanticValidator.FirstDeclarationVisitor subqueryFirstDeclarationVisitor()
           
protected  AbstractSemanticValidator.FirstDeclarationVisitor topLevelFirstDeclarationVisitor()
           
protected  int updateStatus(int result, int index, boolean valid)
          Updates the validation status of an expression at a specified position.
protected  boolean validateAbsExpression(AbsExpression expression)
          Validates the encapsulated expression of the given ABS expression.
protected  void validateAbstractFromClause(AbstractFromClause expression, AbstractSemanticValidator.FirstDeclarationVisitor visitor)
          Validates the given FROM clause.
protected  boolean validateAbstractSchemaName(AbstractSchemaName expression)
          Validates the given AbstractSchemaName.
protected  int validateAdditionExpression(AdditionExpression expression)
          Validates the encapsulated expression of the given addition expression.
protected  void validateAllOrAnyExpression(AllOrAnyExpression expression)
          Validates the given AllOrAnyExpression.
protected  void validateAndExpression(AndExpression expression)
          Validates the given AndExpression.
protected  int validateArithmeticExpression(ArithmeticExpression expression, java.lang.String leftExpressionWrongTypeMessageKey, java.lang.String rightExpressionWrongTypeMessageKey)
          Validates the type of the left and right expressions defined by the given ArithmeticExpression.
protected  boolean validateArithmeticExpression(ArithmeticFactor expression)
          Validates the arithmetic factor expression.
protected  boolean validateAvgFunction(AvgFunction expression)
          Validates the encapsulated expression of the given AVG expression.
protected  int validateBetweenExpression(BetweenExpression expression)
          Validates the given BetweenExpression.
protected  void validateCaseExpression(CaseExpression expression)
          Validates the given CaseExpression.
protected  void validateCoalesceExpression(CoalesceExpression expression)
          Validates the given CoalesceExpression.
protected  void validateCollectionMemberDeclaration(CollectionMemberDeclaration expression)
          Validates the given CollectionMemberDeclaration.
protected  int validateCollectionMemberExpression(CollectionMemberExpression expression)
          Validates the given CollectionMemberExpression.
protected  boolean validateCollectionValuedPathExpression(Expression expression, boolean collectionTypeOnly)
          Validates the given Expression and makes sure it's a valid collection value path expression.
protected  boolean validateComparisonExpression(ComparisonExpression expression)
          Validates the left and right expressions of the given ComparisonExpression.
protected  boolean validateConcatExpression(ConcatExpression expression)
          Validates the encapsulated expression of the given CONCAT expression.
protected  void validateConstructorExpression(ConstructorExpression expression)
          Validates the given ConstructorExpression.
protected  void validateCountFunction(CountFunction expression)
          Validates the given CountFunction.
protected  void validateDateTime(DateTime expression)
          Validates the given DateTime.
protected  void validateDeleteClause(DeleteClause expression)
          Validates the given DeleteClause.
protected  void validateDeleteStatement(DeleteStatement expression)
          Validates the given DeleteStatement.
protected  int validateDivisionExpression(DivisionExpression expression)
          Validates the encapsulated expression of the given division expression.
protected  boolean validateEntityTypeLiteral(EntityTypeLiteral expression)
           
protected  void validateEntryExpression(EntryExpression expression)
          Validates the given EntryExpression.
protected  void validateExistsExpression(ExistsExpression expression)
          Validates the given ExistsExpression.
protected  void validateFirstDeclaration(AbstractFromClause expression, JPQLQueryDeclaration declaration, AbstractSemanticValidator.FirstDeclarationVisitor visitor)
           
protected  void validateFromClause(FromClause expression)
          Validates the given FromClause.
protected  boolean validateFunctionPathExpression(AbstractSingleEncapsulatedExpression expression)
          Validates the given AbstractSingleEncapsulatedExpression's encapsulated expression if it is a state field path expression and makes sure it is mapping to a basic mapping.
protected  int validateFunctionPathExpression(CompoundExpression expression, AbstractSemanticValidator.PathType pathType)
          Validates the left and right expressions of the given compound expression.
protected  void validateGroupByClause(GroupByClause expression)
          Validates the given GroupByClause.
protected  void validateHavingClause(HavingClause expression)
          Validates the given HavingClause.
protected  boolean validateIdentificationVariable(IdentificationVariable expression)
          Validates the given IdentificationVariable.
protected  boolean validateIdentificationVariable(IdentificationVariable expression, java.lang.String variable)
          Validates the given identification variable.
protected  void validateIdentificationVariableDeclaration(IdentificationVariableDeclaration expression)
          Validates the given InExpression.
protected  void validateIdentificationVariables()
          Validates the identification variables: Assures those used throughout the query have been defined in the FROM clause in the current subquery or in a superquery.
protected  boolean validateIndexExpression(IndexExpression expression)
          Validates the given IndexExpression.
protected  void validateInExpression(InExpression expression)
          Validates the given InExpression.
protected  void validateJoin(Join expression)
          Validates the given Join.
protected  void validateJoinsIdentificationVariable(AbstractFromClause expression, java.util.List<JPQLQueryDeclaration> declarations, JPQLQueryDeclaration declaration, int index)
           
protected  void validateKeyExpression(KeyExpression expression)
          Validates the given KeyExpression.
protected  boolean validateLengthExpression(LengthExpression expression)
          Validates the encapsulated expression of the given LENGTH expression.
protected  int validateLikeExpression(LikeExpression expression)
          Validates the string expression of the given LIKE expression.
protected  int validateLocateExpression(LocateExpression expression)
          Validates the encapsulated expression of the given LOCATE expression.
protected  boolean validateLowerExpression(LowerExpression expression)
          Validates the encapsulated expression of the given LOWER expression.
protected  boolean validateMaxFunction(MaxFunction expression)
          Validates the encapsulated expression of the given MAX expression.
protected  boolean validateMinFunction(MinFunction expression)
          Validates the encapsulated expression of the given MIN expression.
protected  int validateModExpression(ModExpression expression)
          Validates the encapsulated expression of the given MOD expression.
protected  int validateMultiplicationExpression(MultiplicationExpression expression)
          Validates the encapsulated expression of the given multiplication expression.
protected  void validateNotExpression(NotExpression expression)
          Validates the given NotExpression.
protected  void validateNullComparisonExpression(NullComparisonExpression expression)
          Validates the given NullComparisonExpression.
protected  void validateNullIfExpression(NullIfExpression expression)
          Validates the given NullIfExpression.
protected  void validateObjectExpression(ObjectExpression expression)
          Validates the given ObjectExpression.
protected  void validateOnClause(OnClause expression)
          Validates the given OnClause.
protected  void validateOrderByClause(OrderByClause expression)
          Validates the given OrderByItem.
protected  void validateOrderByItem(OrderByItem expression)
          Validates the given OrderByItem.
protected  void validateOrExpression(OrExpression expression)
          Validates the given OrExpression.
protected  void validateRangeVariableDeclaration(RangeVariableDeclaration expression)
          Validates the given RangeVariableDeclaration.
protected  void validateRangeVariableDeclarationRootObject(RangeVariableDeclaration expression)
          Validates the "root" object of the given RangeVariableDeclaration.
protected  void validateResultVariable(ResultVariable expression)
          Validates the given ResultVariable.
protected  void validateSelectClause(SelectClause expression)
          Validates the given validateSelectClause.
protected  void validateSelectStatement(SelectStatement expression)
          Validates the given SelectStatement.
protected  void validateSimpleFromClause(SimpleFromClause expression)
          Validates the given SimpleFromClause.
protected  void validateSimpleSelectClause(SimpleSelectClause expression)
          Validates the given SimpleSelectClause.
protected  void validateSimpleSelectStatement(SimpleSelectStatement expression)
           
protected  boolean validateSizeExpression(SizeExpression expression)
          Validates the given SizeExpression.
protected  boolean validateSqrtExpression(SqrtExpression expression)
          Validates the encapsulated expression of the given SQRT expression.
protected  boolean validateStateFieldPathExpression(StateFieldPathExpression expression, AbstractSemanticValidator.PathType pathType)
          Validates the given StateFieldPathExpression.
protected  int validateSubstringExpression(SubstringExpression expression)
          Validates the encapsulated expression of the given SUBSTRING expression.
protected  int validateSubtractionExpression(SubtractionExpression expression)
          Validates the encapsulated expression of the given subtraction expression.
protected  boolean validateSumFunction(SumFunction expression)
          Validates the encapsulated expression of the given MOD expression.
protected  void validateTreatExpression(TreatExpression expression)
          Validates the given TreatExpression.
protected  boolean validateTrimExpression(TrimExpression expression)
          Validates the encapsulated expression of the given TRIM expression.
protected  boolean validateTypeExpression(TypeExpression expression)
          Validates the given TypeExpression.
protected  void validateUpdateClause(UpdateClause expression)
          Validates the given UpdateClause.
protected  boolean validateUpdateItem(UpdateItem expression)
          Validates the given UpdateItem by validating the traversability of the path expression.
protected  void validateUpdateStatement(UpdateStatement expression)
          Validates the given UpdateStatement.
protected  boolean validateUpperExpression(UpperExpression expression)
          Validates the encapsulated expression of the given UPPER expression.
protected  void validateValueExpression(ValueExpression expression)
          Validates the given ValueExpression.
protected  void validateWhenClause(WhenClause expression)
          Validates the given WhenClause.
protected  void validateWhereClause(WhereClause expression)
          Validates the given WhereClause.
protected  AbstractSemanticValidator.PathType validPathExpressionTypeForInExpression()
          Returns the type of path expression that is valid for the expression being tested by an IN expression; which is the left expression.
protected  AbstractSemanticValidator.PathType validPathExpressionTypeForStringExpression()
          Returns the type of path expression that is valid for a string expression; which is the left expression in a LIKE expression.
 void visit(AbsExpression expression)
          Visits the AbsExpression expression.
 void visit(AbstractSchemaName expression)
          Visits the AbstractSchemaName expression.
 void visit(AdditionExpression expression)
          Visits the AdditionExpression expression.
 void visit(AllOrAnyExpression expression)
          Visits the AllOrAnyExpression expression.
 void visit(AndExpression expression)
          Visits the AndExpression expression.
 void visit(ArithmeticFactor expression)
          Visits the ArithmeticFactor expression.
 void visit(AvgFunction expression)
          Visits the AvgFunction expression.
 void visit(BadExpression expression)
          Visits the BadExpression expression.
 void visit(BetweenExpression expression)
          Visits the BetweenExpression expression.
 void visit(CaseExpression expression)
          Visits the CaseExpression expression.
 void visit(CoalesceExpression expression)
          Visits the CoalesceExpression expression.
 void visit(CollectionExpression expression)
          Visits the CollectionExpression expression.
 void visit(CollectionMemberDeclaration expression)
          Visits the CollectionMemberDeclaration expression.
 void visit(CollectionMemberExpression expression)
          Visits the CollectionMemberExpression expression.
 void visit(CollectionValuedPathExpression expression)
          Visits the CollectionValuedPathExpression expression.
 void visit(ComparisonExpression expression)
          Visits the ComparisonExpression expression.
 void visit(ConcatExpression expression)
          Visits the ConcatExpression expression.
 void visit(ConstructorExpression expression)
          Visits the ConstructorExpression expression.
 void visit(CountFunction expression)
          Visits the CountFunction expression.
 void visit(DateTime expression)
          Visits the DateTime expression.
 void visit(DeleteClause expression)
          Visits the DeleteClause expression.
 void visit(DeleteStatement expression)
          Visits the DeleteStatement expression.
 void visit(DivisionExpression expression)
          Visits the DivisionExpression expression.
 void visit(EmptyCollectionComparisonExpression expression)
          Visits the EmptyCollectionComparisonExpression expression.
 void visit(EntityTypeLiteral expression)
          Visits the EntityTypeLiteral expression.
 void visit(EntryExpression expression)
          Visits the EntryExpression expression.
 void visit(ExistsExpression expression)
          Visits the ExistsExpression expression.
 void visit(FromClause expression)
          Visits the FromClause expression.
 void visit(GroupByClause expression)
          Visits the GroupByClause expression.
 void visit(HavingClause expression)
          Visits the HavingClause expression.
 void visit(IdentificationVariable expression)
          Visits the IdentificationVariable expression.
 void visit(IdentificationVariableDeclaration expression)
          Visits the IdentificationVariableDeclaration expression.
 void visit(IndexExpression expression)
          Visits the IndexExpression expression.
 void visit(InExpression expression)
          Visits the InExpression expression.
 void visit(InputParameter expression)
          Visits the InputParameter expression.
 void visit(Join expression)
          Visits the Join expression.
 void visit(JPQLExpression expression)
          Visits the JPQLExpression expression.
 void visit(KeyExpression expression)
          Visits the KeyExpression expression.
 void visit(KeywordExpression expression)
          Visits the KeywordExpression expression.
 void visit(LengthExpression expression)
          Visits the LengthExpression expression.
 void visit(LikeExpression expression)
          Visits the LikeExpression expression.
 void visit(LocateExpression expression)
          Visits the LocateExpression expression.
 void visit(LowerExpression expression)
          Visits the LowerExpression expression.
 void visit(MaxFunction expression)
          Visits the MaxFunction expression.
 void visit(MinFunction expression)
          Visits the MinFunction expression.
 void visit(ModExpression expression)
          Visits the ModExpression expression.
 void visit(MultiplicationExpression expression)
          Visits the MultiplicationExpression expression.
 void visit(NotExpression expression)
          Visits the NotExpression expression.
 void visit(NullComparisonExpression expression)
          Visits the NullComparisonExpression expression.
 void visit(NullExpression expression)
          Visits the NullExpression expression.
 void visit(NullIfExpression expression)
          Visits the NullIfExpression expression.
 void visit(NumericLiteral expression)
          Visits the NumericLiteral expression.
 void visit(ObjectExpression expression)
          Visits the ObjectExpression expression.
 void visit(OnClause expression)
          Visits the OnClause expression.
 void visit(OrderByClause expression)
          Visits the OrderByClause expression.
 void visit(OrderByItem expression)
          Visits the OrderByItem expression.
 void visit(OrExpression expression)
          Visits the OrExpression expression.
 void visit(RangeVariableDeclaration expression)
          Visits the RangeVariableDeclaration expression.
 void visit(ResultVariable expression)
          Visits the ResultVariable expression.
 void visit(SelectClause expression)
          Visits the SelectClause expression.
 void visit(SelectStatement expression)
          Visits the SelectStatement expression.
 void visit(SimpleFromClause expression)
          Visits the SimpleFromClause expression.
 void visit(SimpleSelectClause expression)
          Visits the SimpleSelectClause expression.
 void visit(SimpleSelectStatement expression)
          Visits the SimpleSelectStatement expression.
 void visit(SizeExpression expression)
          Visits the SizeExpression expression.
 void visit(SqrtExpression expression)
          Visits the SqrtExpression expression.
 void visit(StateFieldPathExpression expression)
          Visits the StateFieldPathExpression expression.
 void visit(StringLiteral expression)
          Visits the StringLiteral expression.
 void visit(SubExpression expression)
          Visits the SubExpression expression.
 void visit(SubstringExpression expression)
          Visits the SubstringExpression expression.
 void visit(SubtractionExpression expression)
          Visits the SubtractionExpression expression.
 void visit(SumFunction expression)
          Visits the SumFunction expression.
 void visit(TreatExpression expression)
          Visits the TreatExpression expression.
 void visit(TrimExpression expression)
          Visits the TrimExpression expression.
 void visit(TypeExpression expression)
          Visits the TypeExpression expression.
 void visit(UnknownExpression expression)
          Visits the UnknownExpression expression.
 void visit(UpdateClause expression)
          Visits the UpdateClause expression.
 void visit(UpdateItem expression)
          Visits the UpdateItem expression.
 void visit(UpdateStatement expression)
          Visits the UpdateStatement expression.
 void visit(UpperExpression expression)
          Visits the UpperExpression expression.
 void visit(ValueExpression expression)
          Visits the ValueExpression expression.
 void visit(WhenClause expression)
          Visits the WhenClause expression.
 void visit(WhereClause expression)
          Visits the WhereClause expression.
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.AbstractValidator
addProblem, addProblem, addProblem, addProblem, buildChildrenCollector, buildLiteralVisitor, buildOwningClauseVisitor, buildOwningStatementVisitor, buildProblem, buildSubqueryVisitor, getBypassChildCollectionExpressionVisitor, getBypassParentSubExpressionVisitor, getChildren, getChildrenCollectorVisitor, getExpressionRegistry, getExpressionValidator, getJPAVersion, getJPQLQueryBNFValidator, getJPQLQueryBNFValidator, getLiteralVisitor, getOwningClauseVisitor, getOwningStatementVisitor, getProviderVersion, getQueryBNF, getSubqueryVisitor, isSubquery, isValid, isValid, isValid, isValidWithChildCollectionBypass, isWithinSubquery, isWithinTopLevelQuery, length, literal, position, problemsSize, setProblems, visit
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collectionValuedPathExpressionVisitor

protected DefaultSemanticValidator.CollectionValuedPathExpressionVisitor collectionValuedPathExpressionVisitor
This visitor is responsible to retrieve the visited Expression if it is a CollectionValuedPathExpression.


helper

protected final SemanticValidatorHelper helper
The given helper allows this validator to access the JPA artifacts without using Hermes SPI.


registerIdentificationVariable

protected boolean registerIdentificationVariable
This flag is used to register the IdentificationVariables that are used throughout the query (top-level query and subqueries), except the identification variables defining an abstract schema name or a collection-valued path expression.


stateFieldPathExpressionVisitor

protected DefaultSemanticValidator.StateFieldPathExpressionVisitor stateFieldPathExpressionVisitor
This visitor is responsible to retrieve the visited Expression if it is a StateFieldPathExpression.


usedIdentificationVariables

protected java.util.List<IdentificationVariable> usedIdentificationVariables
The IdentificationVariables that are used throughout the query (top-level query and subqueries), except the identification variables defining an abstract schema name or a collection-valued path expression.


virtualIdentificationVariableFinder

protected DefaultSemanticValidator.VirtualIdentificationVariableFinder virtualIdentificationVariableFinder
This finder is responsible to retrieve the virtual identification variable from the UPDATE range declaration since it is optional.

Constructor Detail

AbstractSemanticValidator

protected AbstractSemanticValidator(SemanticValidatorHelper helper)
Creates a new AbstractSemanticValidator.

Parameters:
helper - The given helper allows this validator to access the JPA artifacts without using Hermes SPI
Throws:
java.lang.NullPointerException - The given SemanticValidatorHelper cannot be null
Method Detail

buildComparingEntityTypeLiteralVisitor

protected AbstractSemanticValidator.ComparingEntityTypeLiteralVisitor buildComparingEntityTypeLiteralVisitor()

buildSubqueryFirstDeclarationVisitor

protected AbstractSemanticValidator.SubqueryFirstDeclarationVisitor buildSubqueryFirstDeclarationVisitor()

buildTopLevelFirstDeclarationVisitor

protected AbstractSemanticValidator.TopLevelFirstDeclarationVisitor buildTopLevelFirstDeclarationVisitor()

dispose

public void dispose()
Disposes this visitor.

Overrides:
dispose in class AbstractValidator

findVirtualIdentificationVariable

protected IdentificationVariable findVirtualIdentificationVariable(AbstractSchemaName expression)
Returns the IdentificationVariable that defines the identification variable for either a DELETE or an UPDATE query.

Parameters:
expression - The AbstractSchemaName that is being validated and that most likely representing an associated path expression and not an entity name
Returns:
The IdentificationVariable defining either the identification variable or the virtual identification variable for the DELETE or for the UPDATE query

getCollectionValuedPathExpression

protected CollectionValuedPathExpression getCollectionValuedPathExpression(Expression expression)

getCollectionValuedPathExpressionVisitor

protected DefaultSemanticValidator.CollectionValuedPathExpressionVisitor getCollectionValuedPathExpressionVisitor()

getComparingEntityTypeLiteralVisitor

protected AbstractSemanticValidator.ComparingEntityTypeLiteralVisitor getComparingEntityTypeLiteralVisitor()

getComparisonExpressionVisitor

protected AbstractSemanticValidator.ComparisonExpressionVisitor getComparisonExpressionVisitor()

getGrammar

protected JPQLGrammar getGrammar()
Returns the JPQLGrammar that defines how the JPQL query was parsed.

Specified by:
getGrammar in class AbstractValidator
Returns:
The JPQLGrammar that was used to parse the JPQL query

getStateFieldPathExpression

protected StateFieldPathExpression getStateFieldPathExpression(Expression expression)

getStateFieldPathExpressionVisitor

protected DefaultSemanticValidator.StateFieldPathExpressionVisitor getStateFieldPathExpressionVisitor()

getVirtualIdentificationVariableFinder

protected DefaultSemanticValidator.VirtualIdentificationVariableFinder getVirtualIdentificationVariableFinder()
Returns the visitor that can find the IdentificationVariable of the RangeVariableDeclaration. This should be used when the query is either a DELETE or UPDATE query.

Returns:
The visitor that can traverse the query and returns the IdentificationVariable

initialize

protected void initialize()
Initializes this validator.

Overrides:
initialize in class AbstractValidator

isComparingEntityTypeLiteral

protected boolean isComparingEntityTypeLiteral(IdentificationVariable expression)
Determines whether the given identification variable is used in a comparison expression: "expression = LargeProject".

Parameters:
expression - The IdentificationVariable used to determine its purpose
Returns:
true if the identification variable is used in a comparison expression; false otherwise

isIdentificationVariableDeclaredAfter

protected boolean isIdentificationVariableDeclaredAfter(java.lang.String variableName,
                                                        int variableNameIndex,
                                                        int joinIndex,
                                                        java.util.List<JPQLQueryDeclaration> declarations)

isIdentificationVariableValidInComparison

protected boolean isIdentificationVariableValidInComparison(IdentificationVariable expression)
Determines whether an identification variable can be used in a comparison expression when the operator is either '<', '<=', '>', '>='.

Parameters:
expression - The IdentificationVariable that is mapped to either an entity, a singled-object value field, a collection-valued object field
Returns:
true if it can be used in a ordering comparison expression; false if it can't

isOrderComparison

protected boolean isOrderComparison(ComparisonExpression expression)
Determines whether the given ComparisonExpression compares two expression using one of the following operators: '<', '<=', '>', '>='.

Parameters:
expression - The ComparisonExpression to check what type of operator that is used
Returns:
true if the operator is used to check for order; false if it is not

isValid

protected final boolean isValid(int result,
                                int index)
Determines whether the expression at the given index is valid or not.

Parameters:
result - The integer value containing the bit used to determine the state of an expression at a given position
index - The index that is used to determine the state of the expression
Returns:
true if the expression is valid at the given index

selectClausePathExpressionPathType

protected abstract AbstractSemanticValidator.PathType selectClausePathExpressionPathType()
Returns the type of path expression that is allowed in the SELECT clause.

Returns:
The type of path expressions allowed. The spec defines it as basic or object mapping only, i.e. collection-valued path expression is not allowed

subqueryFirstDeclarationVisitor

protected AbstractSemanticValidator.FirstDeclarationVisitor subqueryFirstDeclarationVisitor()

topLevelFirstDeclarationVisitor

protected AbstractSemanticValidator.FirstDeclarationVisitor topLevelFirstDeclarationVisitor()

updateStatus

protected final int updateStatus(int result,
                                 int index,
                                 boolean valid)
Updates the validation status of an expression at a specified position. The value is stored in an integer value.

Parameters:
result - The integer value that is used to store the validation status of an expression at the given position
index - The position to store the validation status
valid - The new validation status to store
Returns:
The updated integer value

validateAbsExpression

protected boolean validateAbsExpression(AbsExpression expression)
Validates the encapsulated expression of the given ABS expression. The test to perform is:

Parameters:
expression - The AbsExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateAbstractFromClause

protected void validateAbstractFromClause(AbstractFromClause expression,
                                          AbstractSemanticValidator.FirstDeclarationVisitor visitor)
Validates the given FROM clause. This will validate the order of identification variable declarations.

Parameters:
expression - The AbstractFromClause to validate
visitor -

validateAbstractSchemaName

protected boolean validateAbstractSchemaName(AbstractSchemaName expression)
Validates the given AbstractSchemaName. The tests to perform are:

Parameters:
expression - The AbstractSchemaName to validate
Returns:
true if the entity name was resolved; false otherwise

validateAdditionExpression

protected int validateAdditionExpression(AdditionExpression expression)
Validates the encapsulated expression of the given addition expression. The test to perform is:

Parameters:
expression - The AdditionExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateAllOrAnyExpression

protected void validateAllOrAnyExpression(AllOrAnyExpression expression)
Validates the given AllOrAnyExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The AllOrAnyExpression to validate

validateAndExpression

protected void validateAndExpression(AndExpression expression)
Validates the given AndExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The AndExpression to validate

validateArithmeticExpression

protected int validateArithmeticExpression(ArithmeticExpression expression,
                                           java.lang.String leftExpressionWrongTypeMessageKey,
                                           java.lang.String rightExpressionWrongTypeMessageKey)
Validates the type of the left and right expressions defined by the given ArithmeticExpression. The test to perform is:

Parameters:
expression - The ArithmeticExpression to validate
leftExpressionWrongTypeMessageKey - The key used to describe the left expression does not have a valid type
rightExpressionWrongTypeMessageKey - The key used to describe the right expression does not have a valid type
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateArithmeticExpression

protected boolean validateArithmeticExpression(ArithmeticFactor expression)
Validates the arithmetic factor expression. The test to perform is:

Parameters:
expression - The ArithmeticFactor to validate
Returns:
false if the arithmetic factor expression was validated and is invalid; true otherwise

validateAvgFunction

protected boolean validateAvgFunction(AvgFunction expression)
Validates the encapsulated expression of the given AVG expression. The test to perform is:

Parameters:
expression - The AvgFunction to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateBetweenExpression

protected int validateBetweenExpression(BetweenExpression expression)
Validates the given BetweenExpression. The test to perform is:

Parameters:
expression - The BetweenExpression to validate

validateCaseExpression

protected void validateCaseExpression(CaseExpression expression)
Validates the given CaseExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The CaseExpression to validate

validateCoalesceExpression

protected void validateCoalesceExpression(CoalesceExpression expression)
Validates the given CoalesceExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The CoalesceExpression to validate

validateCollectionMemberDeclaration

protected void validateCollectionMemberDeclaration(CollectionMemberDeclaration expression)
Validates the given CollectionMemberDeclaration.

Parameters:
expression - The CollectionMemberDeclaration to validate

validateCollectionMemberExpression

protected int validateCollectionMemberExpression(CollectionMemberExpression expression)
Validates the given CollectionMemberExpression. Only the collection-valued path expression is validated.

Parameters:
expression - The CollectionMemberExpression to validate
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateCollectionValuedPathExpression

protected boolean validateCollectionValuedPathExpression(Expression expression,
                                                         boolean collectionTypeOnly)
Validates the given Expression and makes sure it's a valid collection value path expression.

Parameters:
expression - The Expression to validate
collectionTypeOnly - true to make sure the path expression resolves to a collection mapping only; false if it can simply resolves to a relationship mapping

validateComparisonExpression

protected boolean validateComparisonExpression(ComparisonExpression expression)
Validates the left and right expressions of the given ComparisonExpression. The tests to perform are:

Parameters:
expression - The ConcatExpression to validate by validating its left and right expressions
Returns:
The status of the comparison between the left and right expression: true if the two expressions pass the rules defined by this method; false otherwise

validateConcatExpression

protected boolean validateConcatExpression(ConcatExpression expression)
Validates the encapsulated expression of the given CONCAT expression. The tests to perform are:

Parameters:
expression - The ConcatExpression to validate by validating its encapsulated expression
Returns:
false if the first encapsulated expression was validated and is invalid; true otherwise

validateConstructorExpression

protected void validateConstructorExpression(ConstructorExpression expression)
Validates the given ConstructorExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The ConstructorExpression to validate

validateCountFunction

protected void validateCountFunction(CountFunction expression)
Validates the given CountFunction. The default behavior does not require to semantically validate it.

Parameters:
expression - The CountFunction to validate

validateDateTime

protected void validateDateTime(DateTime expression)
Validates the given DateTime. The default behavior does not require to semantically validate it.

Parameters:
expression - The DateTime to validate

validateDeleteClause

protected void validateDeleteClause(DeleteClause expression)
Validates the given DeleteClause. The default behavior does not require to semantically validate it.

Parameters:
expression - The DeleteClause to validate

validateDeleteStatement

protected void validateDeleteStatement(DeleteStatement expression)
Validates the given DeleteStatement. The default behavior does not require to semantically validate it.

Parameters:
expression - The DeleteStatement to validate

validateDivisionExpression

protected int validateDivisionExpression(DivisionExpression expression)
Validates the encapsulated expression of the given division expression. The test to perform is:

Parameters:
expression - The DivisionExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateEntityTypeLiteral

protected boolean validateEntityTypeLiteral(EntityTypeLiteral expression)

validateEntryExpression

protected void validateEntryExpression(EntryExpression expression)
Validates the given EntryExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The EntryExpression to validate

validateExistsExpression

protected void validateExistsExpression(ExistsExpression expression)
Validates the given ExistsExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The ExistsExpression to validate

validateFirstDeclaration

protected void validateFirstDeclaration(AbstractFromClause expression,
                                        JPQLQueryDeclaration declaration,
                                        AbstractSemanticValidator.FirstDeclarationVisitor visitor)

validateFromClause

protected void validateFromClause(FromClause expression)
Validates the given FromClause.

Parameters:
expression - The FromClause to validate

validateFunctionPathExpression

protected boolean validateFunctionPathExpression(AbstractSingleEncapsulatedExpression expression)
Validates the given AbstractSingleEncapsulatedExpression's encapsulated expression if it is a state field path expression and makes sure it is mapping to a basic mapping. That means relationship field mapping is not allowed.

Parameters:
expression - The AbstractSingleEncapsulatedExpression to validate its encapsulated expression if it's a state field path expression, otherwise does nothing
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateFunctionPathExpression

protected int validateFunctionPathExpression(CompoundExpression expression,
                                             AbstractSemanticValidator.PathType pathType)
Validates the left and right expressions of the given compound expression. The test to perform is:

Parameters:
expression - The CompoundExpression to validate by validating its left and right expressions
associationFieldValid - Determines whether an association field is a valid type
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateGroupByClause

protected void validateGroupByClause(GroupByClause expression)
Validates the given GroupByClause. The default behavior does not require to semantically validate it.

Parameters:
expression - The GroupByClause to validate

validateHavingClause

protected void validateHavingClause(HavingClause expression)
Validates the given HavingClause. The default behavior does not require to semantically validate it.

Parameters:
expression - The HavingClause to validate

validateIdentificationVariable

protected boolean validateIdentificationVariable(IdentificationVariable expression)
Validates the given IdentificationVariable. The test to perform are:

Parameters:
expression - The identification variable to be validated
Returns:
true if the given identification variable is valid; false otherwise

validateIdentificationVariable

protected boolean validateIdentificationVariable(IdentificationVariable expression,
                                                 java.lang.String variable)
Validates the given identification variable. The default behavior is to not validate it.

Parameters:
expression - The IdentificationVariable that is being visited
variable - The actual identification variable, which is never an empty string
Returns:
true if the given identification variable is valid; false otherwise

validateIdentificationVariableDeclaration

protected void validateIdentificationVariableDeclaration(IdentificationVariableDeclaration expression)
Validates the given InExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The InExpression to validate

validateIdentificationVariables

protected void validateIdentificationVariables()
Validates the identification variables:

Parameters:
expression - The InExpression to validate

validateIndexExpression

protected boolean validateIndexExpression(IndexExpression expression)
Validates the given IndexExpression. It validates the identification variable and makes sure is it defined in IN or IN expression.

Parameters:
expression - The IndexExpression to validate

validateInExpression

protected void validateInExpression(InExpression expression)
Validates the given InExpression. The test to perform is:

Parameters:
expression - The InExpression to validate

validateJoin

protected void validateJoin(Join expression)
Validates the given Join.

Parameters:
expression - The ValueExpression to validate

validateJoinsIdentificationVariable

protected void validateJoinsIdentificationVariable(AbstractFromClause expression,
                                                   java.util.List<JPQLQueryDeclaration> declarations,
                                                   JPQLQueryDeclaration declaration,
                                                   int index)

validateKeyExpression

protected void validateKeyExpression(KeyExpression expression)
Validates the given KeyExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The KeyExpression to validate

validateLengthExpression

protected boolean validateLengthExpression(LengthExpression expression)
Validates the encapsulated expression of the given LENGTH expression. The test to perform is:

Parameters:
expression - The LengthExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateLikeExpression

protected int validateLikeExpression(LikeExpression expression)
Validates the string expression of the given LIKE expression. The test to perform is:

Parameters:
expression - The LengthExpression to validate by validating its string expression
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateLocateExpression

protected int validateLocateExpression(LocateExpression expression)
Validates the encapsulated expression of the given LOCATE expression. The test to perform is:

Parameters:
expression - The LocateExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateLowerExpression

protected boolean validateLowerExpression(LowerExpression expression)
Validates the encapsulated expression of the given LOWER expression. The test to perform is:

Parameters:
expression - The LowerExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateMaxFunction

protected boolean validateMaxFunction(MaxFunction expression)
Validates the encapsulated expression of the given MAX expression. The test to perform is:

Parameters:
expression - The MaxFunction to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is not valid; true otherwise

validateMinFunction

protected boolean validateMinFunction(MinFunction expression)
Validates the encapsulated expression of the given MIN expression. The test to perform is:

Parameters:
expression - The MinFunction to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is not valid; true otherwise

validateModExpression

protected int validateModExpression(ModExpression expression)
Validates the encapsulated expression of the given MOD expression. The test to perform is:

Parameters:
expression - The ModExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateMultiplicationExpression

protected int validateMultiplicationExpression(MultiplicationExpression expression)
Validates the encapsulated expression of the given multiplication expression. The test to perform is:

Parameters:
expression - The MultiplicationExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateNotExpression

protected void validateNotExpression(NotExpression expression)
Validates the given NotExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The NotExpression to validate

validateNullComparisonExpression

protected void validateNullComparisonExpression(NullComparisonExpression expression)
Validates the given NullComparisonExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The NullComparisonExpression to validate

validateNullIfExpression

protected void validateNullIfExpression(NullIfExpression expression)
Validates the given NullIfExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The NullIfExpression to validate

validateObjectExpression

protected void validateObjectExpression(ObjectExpression expression)
Validates the given ObjectExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The ObjectExpression to validate

validateOnClause

protected void validateOnClause(OnClause expression)
Validates the given OnClause. The default behavior does not require to semantically validate it.

Parameters:
expression - The OnClause to validate

validateOrderByClause

protected void validateOrderByClause(OrderByClause expression)
Validates the given OrderByItem. The default behavior does not require to semantically validate it.

Parameters:
expression - The OrderByItem to validate

validateOrderByItem

protected void validateOrderByItem(OrderByItem expression)
Validates the given OrderByItem. The default behavior does not require to semantically validate it.

Parameters:
expression - The OrderByItem to validate

validateOrExpression

protected void validateOrExpression(OrExpression expression)
Validates the given OrExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The OrExpression to validate

validateRangeVariableDeclaration

protected void validateRangeVariableDeclaration(RangeVariableDeclaration expression)
Validates the given RangeVariableDeclaration.

Parameters:
expression - The RangeVariableDeclaration to validate

validateRangeVariableDeclarationRootObject

protected void validateRangeVariableDeclarationRootObject(RangeVariableDeclaration expression)
Validates the "root" object of the given RangeVariableDeclaration.

Parameters:
expression - The RangeVariableDeclaration that needs its "root" object to be validated

validateResultVariable

protected void validateResultVariable(ResultVariable expression)
Validates the given ResultVariable. The default behavior does not require to semantically validate it.

Parameters:
expression - The ResultVariable to validate

validateSelectClause

protected void validateSelectClause(SelectClause expression)
Validates the given validateSelectClause. The default behavior does not require to semantically validate it.

Parameters:
expression - The validateSelectClause to validate

validateSelectStatement

protected void validateSelectStatement(SelectStatement expression)
Validates the given SelectStatement. The default behavior does not require to semantically validate it.

Parameters:
expression - The SelectStatement to validate

validateSimpleFromClause

protected void validateSimpleFromClause(SimpleFromClause expression)
Validates the given SimpleFromClause.

Parameters:
expression - The SimpleFromClause to validate

validateSimpleSelectClause

protected void validateSimpleSelectClause(SimpleSelectClause expression)
Validates the given SimpleSelectClause. The default behavior does not require to semantically validate it.

Parameters:
expression - The SimpleSelectClause to validate

validateSimpleSelectStatement

protected void validateSimpleSelectStatement(SimpleSelectStatement expression)

validateSizeExpression

protected boolean validateSizeExpression(SizeExpression expression)
Validates the given SizeExpression.

Parameters:
expression - The SizeExpression to validate
Returns:
false if the encapsulated expression is a collection-valued path expression and it was found to be invalid; true otherwise

validateSqrtExpression

protected boolean validateSqrtExpression(SqrtExpression expression)
Validates the encapsulated expression of the given SQRT expression. The test to perform is:

Parameters:
expression - The SqrtExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateStateFieldPathExpression

protected boolean validateStateFieldPathExpression(StateFieldPathExpression expression,
                                                   AbstractSemanticValidator.PathType pathType)
Validates the given StateFieldPathExpression.

Parameters:
expression - The StateFieldPathExpression the validate
pathType - The type of field that is allowed
Returns:
true if the given StateFieldPathExpression resolves to a valid path; false otherwise

validateSubstringExpression

protected int validateSubstringExpression(SubstringExpression expression)
Validates the encapsulated expression of the given SUBSTRING expression. The test to perform is:

Parameters:
expression - The SubstringExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateSubtractionExpression

protected int validateSubtractionExpression(SubtractionExpression expression)
Validates the encapsulated expression of the given subtraction expression. The test to perform is:

Parameters:
expression - The SubtractionExpression to validate by validating its encapsulated expression
Returns:
A number indicating the validation result. isValid(int, int) can be used to determine the validation status of an expression based on its position

validateSumFunction

protected boolean validateSumFunction(SumFunction expression)
Validates the encapsulated expression of the given MOD expression. The test to perform is:

Parameters:
expression - The ModExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateTreatExpression

protected void validateTreatExpression(TreatExpression expression)
Validates the given TreatExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The TreatExpression to validate

validateTrimExpression

protected boolean validateTrimExpression(TrimExpression expression)
Validates the encapsulated expression of the given TRIM expression. The test to perform is:

Parameters:
expression - The TrimExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateTypeExpression

protected boolean validateTypeExpression(TypeExpression expression)
Validates the given TypeExpression. The test to perform is:

Parameters:
expression - The TypeExpression to validate
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateUpdateClause

protected void validateUpdateClause(UpdateClause expression)
Validates the given UpdateClause. The default behavior does not require to semantically validate it.

Parameters:
expression - The UpdateClause to validate

validateUpdateItem

protected boolean validateUpdateItem(UpdateItem expression)
Validates the given UpdateItem by validating the traversability of the path expression. The path expression is valid if it follows one of the following rules:

Parameters:
expression - UpdateItem to validate its path expression
Returns:
true if the path expression is valid; false otherwise

validateUpdateStatement

protected void validateUpdateStatement(UpdateStatement expression)
Validates the given UpdateStatement. The default behavior does not require to semantically validate it.

Parameters:
expression - The UpdateStatement to validate

validateUpperExpression

protected boolean validateUpperExpression(UpperExpression expression)
Validates the encapsulated expression of the given UPPER expression. The test to perform is:

Parameters:
expression - The UpperExpression to validate by validating its encapsulated expression
Returns:
false if the encapsulated expression was validated and is invalid; true otherwise

validateValueExpression

protected void validateValueExpression(ValueExpression expression)
Validates the given ValueExpression. The default behavior does not require to semantically validate it.

Parameters:
expression - The ValueExpression to validate

validateWhenClause

protected void validateWhenClause(WhenClause expression)
Validates the given WhenClause. The default behavior does not require to semantically validate it.

Parameters:
expression - The WhenClause to validate

validateWhereClause

protected void validateWhereClause(WhereClause expression)
Validates the given WhereClause. The default behavior does not require to semantically validate it.

Parameters:
expression - The WhereClause to validate

validPathExpressionTypeForInExpression

protected AbstractSemanticValidator.PathType validPathExpressionTypeForInExpression()
Returns the type of path expression that is valid for the expression being tested by an IN expression; which is the left expression.

Returns:
By default, any field (without collection) is allowed

validPathExpressionTypeForStringExpression

protected AbstractSemanticValidator.PathType validPathExpressionTypeForStringExpression()
Returns the type of path expression that is valid for a string expression; which is the left expression in a LIKE expression.

Returns:
By default, only basic field are allowed

visit

public final void visit(AbsExpression expression)
Visits the AbsExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(AbstractSchemaName expression)
Visits the AbstractSchemaName expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(AdditionExpression expression)
Visits the AdditionExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(AllOrAnyExpression expression)
Visits the AllOrAnyExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(AndExpression expression)
Visits the AndExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(ArithmeticFactor expression)
Visits the ArithmeticFactor expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(AvgFunction expression)
Visits the AvgFunction expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(BadExpression expression)
Visits the BadExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(BetweenExpression expression)
Visits the BetweenExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(CaseExpression expression)
Visits the CaseExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(CoalesceExpression expression)
Visits the CoalesceExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(CollectionExpression expression)
Visits the CollectionExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(CollectionMemberDeclaration expression)
Visits the CollectionMemberDeclaration expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(CollectionMemberExpression expression)
Visits the CollectionMemberExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(CollectionValuedPathExpression expression)
Visits the CollectionValuedPathExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(ComparisonExpression expression)
Visits the ComparisonExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(ConcatExpression expression)
Visits the ConcatExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(ConstructorExpression expression)
Visits the ConstructorExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(CountFunction expression)
Visits the CountFunction expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(DateTime expression)
Visits the DateTime expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(DeleteClause expression)
Visits the DeleteClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(DeleteStatement expression)
Visits the DeleteStatement expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(DivisionExpression expression)
Visits the DivisionExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(EmptyCollectionComparisonExpression expression)
Visits the EmptyCollectionComparisonExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(EntityTypeLiteral expression)
Visits the EntityTypeLiteral expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(EntryExpression expression)
Visits the EntryExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(ExistsExpression expression)
Visits the ExistsExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(FromClause expression)
Visits the FromClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(GroupByClause expression)
Visits the GroupByClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(HavingClause expression)
Visits the HavingClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(IdentificationVariable expression)
Visits the IdentificationVariable expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(IdentificationVariableDeclaration expression)
Visits the IdentificationVariableDeclaration expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(IndexExpression expression)
Visits the IndexExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(InExpression expression)
Visits the InExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(InputParameter expression)
Visits the InputParameter expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(Join expression)
Visits the Join expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(JPQLExpression expression)
Visits the JPQLExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(KeyExpression expression)
Visits the KeyExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(KeywordExpression expression)
Visits the KeywordExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(LengthExpression expression)
Visits the LengthExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(LikeExpression expression)
Visits the LikeExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(LocateExpression expression)
Visits the LocateExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(LowerExpression expression)
Visits the LowerExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(MaxFunction expression)
Visits the MaxFunction expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(MinFunction expression)
Visits the MinFunction expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(ModExpression expression)
Visits the ModExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(MultiplicationExpression expression)
Visits the MultiplicationExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(NotExpression expression)
Visits the NotExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(NullComparisonExpression expression)
Visits the NullComparisonExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(NullExpression expression)
Visits the NullExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(NullIfExpression expression)
Visits the NullIfExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(NumericLiteral expression)
Visits the NumericLiteral expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(ObjectExpression expression)
Visits the ObjectExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(OnClause expression)
Visits the OnClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(OrderByClause expression)
Visits the OrderByClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(OrderByItem expression)
Visits the OrderByItem expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(OrExpression expression)
Visits the OrExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(RangeVariableDeclaration expression)
Visits the RangeVariableDeclaration expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(ResultVariable expression)
Visits the ResultVariable expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SelectClause expression)
Visits the SelectClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SelectStatement expression)
Visits the SelectStatement expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SimpleFromClause expression)
Visits the SimpleFromClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SimpleSelectClause expression)
Visits the SimpleSelectClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SimpleSelectStatement expression)
Visits the SimpleSelectStatement expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SizeExpression expression)
Visits the SizeExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SqrtExpression expression)
Visits the SqrtExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(StateFieldPathExpression expression)
Visits the StateFieldPathExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(StringLiteral expression)
Visits the StringLiteral expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SubExpression expression)
Visits the SubExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SubstringExpression expression)
Visits the SubstringExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SubtractionExpression expression)
Visits the SubtractionExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(SumFunction expression)
Visits the SumFunction expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(TreatExpression expression)
Visits the TreatExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(TrimExpression expression)
Visits the TrimExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(TypeExpression expression)
Visits the TypeExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The Expression to visit

visit

public final void visit(UnknownExpression expression)
Visits the UnknownExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The UnknownExpression to visit

visit

public final void visit(UpdateClause expression)
Visits the UpdateClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The UpdateClause to visit

visit

public final void visit(UpdateItem expression)
Visits the UpdateItem expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The UpdateItem to visit

visit

public final void visit(UpdateStatement expression)
Visits the UpdateStatement expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The UpdateStatement to visit

visit

public final void visit(UpperExpression expression)
Visits the UpperExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The UpperExpression to visit

visit

public final void visit(ValueExpression expression)
Visits the ValueExpression expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The ValueExpression to visit

visit

public final void visit(WhenClause expression)
Visits the WhenClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The WhenClause to visit

visit

public final void visit(WhereClause expression)
Visits the WhereClause expression.

Specified by:
visit in interface ExpressionVisitor
Overrides:
visit in class AnonymousExpressionVisitor
Parameters:
expression - The WhereClause to visit

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference