public class HqlSqlWalker extends HqlSqlBaseWalker implements ErrorReporter, ParameterBinder.NamedParameterSource
SqlASTFactory_tokenNames, _tokenSet_0, _tokenSet_1_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNamesAGGREGATE, ALIAS, ALIAS_REF, ALL, AND, ANY, AS, ASCENDING, AVG, BETWEEN, BOGUS, BOTH, CASE, CASE2, CAST, CLASS, CLOSE, CLOSE_BRACKET, COLON, COMMA, CONCAT, CONSTANT, CONSTRUCTOR, COUNT, DELETE, DESCENDING, DISTINCT, DIV, DOT, ELEMENTS, ELSE, EMPTY, END, ENTITY_JOIN, ENTRY, EOF, EQ, ESCAPE, ESCqs, EXISTS, EXPONENT, EXPR_LIST, FALSE, FETCH, FILTER_ENTITY, FILTERS, FIRST, FLOAT_SUFFIX, FROM, FROM_FRAGMENT, FULL, GE, GROUP, GT, HAVING, HEX_DIGIT, ID_LETTER, ID_START_LETTER, IDENT, IMPLIED_FROM, IN, IN_LIST, INDEX_OP, INDICES, INNER, INSERT, INTO, IS, IS_NOT_NULL, IS_NULL, JAVA_CONSTANT, JOIN, JOIN_FRAGMENT, KEY, LAST, LE, LEADING, LEFT, LEFT_OUTER, LIKE, LITERAL_ascending, LITERAL_by, LITERAL_descending, LT, MAX, MEMBER, METHOD_CALL, METHOD_NAME, MIN, MINUS, MOD, NAMED_PARAM, NE, NEW, NOT, NOT_BETWEEN, NOT_IN, NOT_LIKE, NULL, NULL_TREE_LOOKAHEAD, NULLS, NUM_BIG_DECIMAL, NUM_BIG_INTEGER, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, OBJECT, OF, ON, OPEN, OPEN_BRACKET, OR, ORDER, ORDER_ELEMENT, OUTER, PARAM, PLUS, PROPERTIES, PROPERTY_REF, QUERY, QUOTED_STRING, RANGE, RESULT_VARIABLE_REF, RIGHT, RIGHT_OUTER, ROW_STAR, SELECT, SELECT_CLAUSE, SELECT_COLUMNS, SELECT_EXPR, SELECT_FROM, SET, SOME, SQL_NE, SQL_TOKEN, STAR, SUM, THEN, THETA_JOINS, TRAILING, TRUE, UNARY_MINUS, UNARY_PLUS, UPDATE, VALUE, VECTOR_EXPR, VERSIONED, WEIRD_IDENT, WHEN, WHERE, WITH, WS| Constructor and Description |
|---|
HqlSqlWalker(QueryTranslatorImpl qti,
SessionFactoryImplementor sfi,
HqlParser parser,
Map tokenReplacements,
String collectionRole)
Create a new tree transformer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addQuerySpaces(Serializable[] spaces) |
protected void |
beforeSelectClause() |
protected antlr.collections.AST |
createFromElement(String path,
antlr.collections.AST alias,
antlr.collections.AST propertyFetch) |
protected antlr.collections.AST |
createFromFilterElement(antlr.collections.AST filterEntity,
antlr.collections.AST alias) |
protected void |
createFromJoinElement(antlr.collections.AST path,
antlr.collections.AST alias,
int joinType,
antlr.collections.AST fetchNode,
antlr.collections.AST propertyFetch,
antlr.collections.AST with) |
protected antlr.collections.AST |
createIntoClause(String path,
antlr.collections.AST propertySpec) |
protected void |
evaluateAssignment(antlr.collections.AST eq) |
protected void |
finishFromClause(antlr.collections.AST fromClause) |
protected antlr.collections.AST |
generateNamedParameter(antlr.collections.AST delimiterNode,
antlr.collections.AST nameNode) |
protected antlr.collections.AST |
generatePositionalParameter(antlr.collections.AST inputNode) |
AliasGenerator |
getAliasGenerator() |
ArrayList |
getAssignmentSpecifications() |
ASTPrinter |
getASTPrinter() |
String |
getCollectionFilterRole() |
FromClause |
getCurrentFromClause() |
Map |
getEnabledFilters() |
FromClause |
getFinalFromClause() |
JoinType |
getImpliedJoinType() |
LiteralProcessor |
getLiteralProcessor() |
int[] |
getNamedParameterLocations(String name)
Returns the locations of all occurrences of the named parameter.
|
int |
getNumberOfParametersInSetClause() |
ArrayList<ParameterSpecification> |
getParameters() |
ParseErrorHandler |
getParseErrorHandler() |
Set<Serializable> |
getQuerySpaces()
Returns the set of unique query spaces (a.k.a.
|
String[] |
getReturnAliases() |
Type[] |
getReturnTypes() |
SelectClause |
getSelectClause() |
SessionFactoryHelper |
getSessionFactoryHelper() |
Map |
getTokenReplacements() |
Set<String> |
getTreatAsDeclarationsByPath(String path) |
protected void |
handleResultVariableRef(antlr.collections.AST resultVariableRef) |
boolean |
isFilter() |
boolean |
isInEntityGraph() |
protected boolean |
isNonQualifiedPropertyRef(antlr.collections.AST ident) |
protected boolean |
isOrderExpressionResultVariableRef(antlr.collections.AST orderExpressionNode) |
boolean |
isShallowQuery() |
protected void |
lookupAlias(antlr.collections.AST aliasRef) |
protected antlr.collections.AST |
lookupNonQualifiedProperty(antlr.collections.AST property) |
protected antlr.collections.AST |
lookupProperty(antlr.collections.AST dot,
boolean root,
boolean inSelect) |
static void |
panic() |
protected void |
postProcessDelete(antlr.collections.AST delete) |
protected void |
postProcessDML(RestrictableStatement statement) |
protected void |
postProcessInsert(antlr.collections.AST insert) |
protected void |
postProcessUpdate(antlr.collections.AST update) |
protected void |
prepareArithmeticOperator(antlr.collections.AST operator) |
protected void |
prepareFromClauseInputTree(antlr.collections.AST fromClauseInput)
Pre-process the from clause input tree.
|
protected void |
prepareLogicOperator(antlr.collections.AST operator) |
protected void |
prepareVersioned(antlr.collections.AST updateNode,
antlr.collections.AST versioned) |
protected void |
processAggregation(antlr.collections.AST node,
boolean inSelect) |
protected void |
processBoolean(antlr.collections.AST constant) |
protected void |
processCastFunction(antlr.collections.AST castFunctionCall,
boolean inSelect) |
protected void |
processConstant(antlr.collections.AST constant) |
protected void |
processConstructor(antlr.collections.AST constructor) |
protected void |
processFunction(antlr.collections.AST functionCall,
boolean inSelect) |
protected void |
processIndex(antlr.collections.AST indexOp) |
protected void |
processNumericLiteral(antlr.collections.AST literal) |
protected void |
processQuery(antlr.collections.AST select,
antlr.collections.AST query) |
protected void |
pushFromClause(antlr.collections.AST fromNode,
antlr.collections.AST inputFromNode)
Sets the current 'FROM' context.
|
void |
reportError(antlr.RecognitionException e) |
void |
reportError(String s) |
void |
reportWarning(String s) |
protected void |
resolve(antlr.collections.AST node) |
protected void |
resolveSelectExpression(antlr.collections.AST node) |
protected void |
setAlias(antlr.collections.AST selectExpr,
antlr.collections.AST ident) |
protected void |
setImpliedJoinType(int joinType) |
void |
traceIn(String ruleName,
antlr.collections.AST tree) |
void |
traceOut(String ruleName,
antlr.collections.AST tree) |
protected void |
validateMapPropertyExpression(antlr.collections.AST node) |
addrExpr, addrExprLhs, aggregateExpr, aliasedSelectExpr, aliasRef, arithmeticExpr, assignment, caseExpr, collectionFunction, collectionFunctionOrSubselect, comparisonExpr, constant, constructor, count, deleteStatement, elseClause, expr, expressionOrSubQuery, exprOrSubquery, fromClause, fromElement, fromElementList, functionCall, getCurrentClauseType, getCurrentStatementType, getCurrentTopLevelClauseType, getStatementType, groupClause, identifier, inRhs, insertablePropertySpec, insertStatement, intoClause, isComparativeExpressionClause, isInCase, isInCount, isInCountDistinct, isInFrom, isInFunctionCall, isInSelect, isSelectStatement, isSubQuery, joinElement, joinType, literal, logicalExpr, mapComponentReference, mapPropertyExpression, newValue, nullOrdering, nullPrecedence, numericInteger, orderClause, orderExpr, orderExprs, parameter, path, pathAsIdent, processMapComponentReference, propertyName, propertyRef, propertyRefLhs, query, resultVariableRef, searchedCaseExpression, searchedCaseWhenClause, selectClause, selectExpr, selectExprList, selectStatement, setClause, simpleCaseExpression, simpleCaseWhenClause, statement, updateStatement, whereClause, withClausepublic HqlSqlWalker(QueryTranslatorImpl qti, SessionFactoryImplementor sfi, HqlParser parser, Map tokenReplacements, String collectionRole)
qti - Back pointer to the query translator implementation that is using this tree transform.sfi - The session factory implementor where the Hibernate mappings can be found.parser - A reference to the phase-1 parsertokenReplacements - Registers the token replacement map with the walker. This map will
be used to substitute function names and constants.collectionRole - The collection role name of the collection used as the basis for the
filter, NULL if this is not a collection filter compilation.public void traceIn(String ruleName, antlr.collections.AST tree)
traceIn in class antlr.TreeParserpublic void traceOut(String ruleName, antlr.collections.AST tree)
traceOut in class antlr.TreeParserprotected void prepareFromClauseInputTree(antlr.collections.AST fromClauseInput)
HqlSqlBaseWalkerprepareFromClauseInputTree in class HqlSqlBaseWalkerpublic boolean isFilter()
public String getCollectionFilterRole()
public boolean isInEntityGraph()
public SessionFactoryHelper getSessionFactoryHelper()
public Map getTokenReplacements()
public AliasGenerator getAliasGenerator()
public FromClause getCurrentFromClause()
public ParseErrorHandler getParseErrorHandler()
public void reportError(antlr.RecognitionException e)
reportError in interface ErrorReporterreportError in class antlr.TreeParserpublic void reportError(String s)
reportError in interface ErrorReporterreportError in class antlr.TreeParserpublic void reportWarning(String s)
reportWarning in interface ErrorReporterreportWarning in class antlr.TreeParserpublic Set<Serializable> getQuerySpaces()
protected antlr.collections.AST createFromElement(String path, antlr.collections.AST alias, antlr.collections.AST propertyFetch) throws antlr.SemanticException
createFromElement in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected antlr.collections.AST createFromFilterElement(antlr.collections.AST filterEntity,
antlr.collections.AST alias)
throws antlr.SemanticException
createFromFilterElement in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void createFromJoinElement(antlr.collections.AST path,
antlr.collections.AST alias,
int joinType,
antlr.collections.AST fetchNode,
antlr.collections.AST propertyFetch,
antlr.collections.AST with)
throws antlr.SemanticException
createFromJoinElement in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void finishFromClause(antlr.collections.AST fromClause)
throws antlr.SemanticException
finishFromClause in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void pushFromClause(antlr.collections.AST fromNode,
antlr.collections.AST inputFromNode)
pushFromClause in class HqlSqlBaseWalkerfromNode - The new 'FROM' context.inputFromNode - The from node from the input AST.protected void lookupAlias(antlr.collections.AST aliasRef)
throws antlr.SemanticException
lookupAlias in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void setImpliedJoinType(int joinType)
setImpliedJoinType in class HqlSqlBaseWalkerpublic JoinType getImpliedJoinType()
protected antlr.collections.AST lookupProperty(antlr.collections.AST dot,
boolean root,
boolean inSelect)
throws antlr.SemanticException
lookupProperty in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected boolean isNonQualifiedPropertyRef(antlr.collections.AST ident)
isNonQualifiedPropertyRef in class HqlSqlBaseWalkerprotected antlr.collections.AST lookupNonQualifiedProperty(antlr.collections.AST property)
throws antlr.SemanticException
lookupNonQualifiedProperty in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void processQuery(antlr.collections.AST select,
antlr.collections.AST query)
throws antlr.SemanticException
processQuery in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void postProcessDML(RestrictableStatement statement) throws antlr.SemanticException
antlr.SemanticExceptionprotected void postProcessUpdate(antlr.collections.AST update)
throws antlr.SemanticException
postProcessUpdate in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void postProcessDelete(antlr.collections.AST delete)
throws antlr.SemanticException
postProcessDelete in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void postProcessInsert(antlr.collections.AST insert)
throws antlr.SemanticException,
QueryException
postProcessInsert in class HqlSqlBaseWalkerantlr.SemanticExceptionQueryExceptionprotected void resolve(antlr.collections.AST node)
throws antlr.SemanticException
resolve in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void resolveSelectExpression(antlr.collections.AST node)
throws antlr.SemanticException
resolveSelectExpression in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void beforeSelectClause()
throws antlr.SemanticException
beforeSelectClause in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected antlr.collections.AST generatePositionalParameter(antlr.collections.AST inputNode)
throws antlr.SemanticException
generatePositionalParameter in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected antlr.collections.AST generateNamedParameter(antlr.collections.AST delimiterNode,
antlr.collections.AST nameNode)
throws antlr.SemanticException
generateNamedParameter in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void processConstant(antlr.collections.AST constant)
throws antlr.SemanticException
processConstant in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void processBoolean(antlr.collections.AST constant)
throws antlr.SemanticException
processBoolean in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void processNumericLiteral(antlr.collections.AST literal)
processNumericLiteral in class HqlSqlBaseWalkerprotected void processIndex(antlr.collections.AST indexOp)
throws antlr.SemanticException
processIndex in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void processFunction(antlr.collections.AST functionCall,
boolean inSelect)
throws antlr.SemanticException
processFunction in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void processCastFunction(antlr.collections.AST castFunctionCall,
boolean inSelect)
throws antlr.SemanticException
processCastFunction in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void processAggregation(antlr.collections.AST node,
boolean inSelect)
throws antlr.SemanticException
processAggregation in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void processConstructor(antlr.collections.AST constructor)
throws antlr.SemanticException
processConstructor in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void setAlias(antlr.collections.AST selectExpr,
antlr.collections.AST ident)
setAlias in class HqlSqlBaseWalkerprotected boolean isOrderExpressionResultVariableRef(antlr.collections.AST orderExpressionNode)
throws antlr.SemanticException
isOrderExpressionResultVariableRef in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void handleResultVariableRef(antlr.collections.AST resultVariableRef)
throws antlr.SemanticException
handleResultVariableRef in class HqlSqlBaseWalkerantlr.SemanticExceptionpublic int[] getNamedParameterLocations(String name) throws QueryException
getNamedParameterLocations in interface ParameterBinder.NamedParameterSourcename - The parameter nameQueryExceptionpublic void addQuerySpaces(Serializable[] spaces)
public Type[] getReturnTypes()
public String[] getReturnAliases()
public SelectClause getSelectClause()
public FromClause getFinalFromClause()
public boolean isShallowQuery()
public Map getEnabledFilters()
public LiteralProcessor getLiteralProcessor()
public ASTPrinter getASTPrinter()
public ArrayList<ParameterSpecification> getParameters()
public int getNumberOfParametersInSetClause()
protected void evaluateAssignment(antlr.collections.AST eq)
throws antlr.SemanticException
evaluateAssignment in class HqlSqlBaseWalkerantlr.SemanticExceptionpublic ArrayList getAssignmentSpecifications()
protected antlr.collections.AST createIntoClause(String path, antlr.collections.AST propertySpec) throws antlr.SemanticException
createIntoClause in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void prepareVersioned(antlr.collections.AST updateNode,
antlr.collections.AST versioned)
throws antlr.SemanticException
prepareVersioned in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void prepareLogicOperator(antlr.collections.AST operator)
throws antlr.SemanticException
prepareLogicOperator in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void prepareArithmeticOperator(antlr.collections.AST operator)
throws antlr.SemanticException
prepareArithmeticOperator in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void validateMapPropertyExpression(antlr.collections.AST node)
throws antlr.SemanticException
validateMapPropertyExpression in class HqlSqlBaseWalkerantlr.SemanticExceptionpublic static void panic()
Copyright © 2017 JBoss by Red Hat. All rights reserved.