Top Description Fields Constructors Methods
org.hibernate.hql.antlr

public Class HqlSqlBaseWalker

extends TreeParser
implements HqlSqlTokenTypes
Class Inheritance
All Implemented Interfaces
org.hibernate.hql.antlr.HqlSqlTokenTypes
Known Direct Subclasses
org.hibernate.hql.ast.HqlSqlWalker
Imports
org.slf4j.Logger, .LoggerFactory, antlr.TreeParser, .Token, .RecognitionException, .ANTLRException, .NoViableAltException, .MismatchedTokenException, .SemanticException, .ASTPair, antlr.collections.AST, antlr.collections.impl.BitSet, .ASTArray

Hibernate Query Language to SQL Tree Transform.
This is a tree grammar that transforms an HQL AST into a intermediate SQL AST with bindings to Hibernate interfaces (Queryable, etc.). The Hibernate specific methods are all implemented in the HqlSqlWalker subclass, allowing the ANTLR-generated class to have only the minimum dependencies on the Hibernate code base. This will also allow the sub-class to be easily edited using an IDE (most IDE's don't support ANTLR)

Note

The java class is generated from hql-sql.g by ANTLR. DO NOT EDIT THE GENERATED JAVA SOURCE CODE.

Author
Joshua Davis ([email protected])

Field Summary

Modifier and TypeField and Description
public static final String[]
public static final BitSet
public static final BitSet
private int
private int
private int
private boolean
private boolean
private boolean
private boolean
private int
private static Logger
private int
private String
Inherited from antlr.TreeParser:
_retTreeastFactoryASTNULLinputStatereturnASTtokenNamestraceDepth

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final void
addrExpr(AST _t, boolean root)

public final void
private void
public final void
public final void
public final void
public final void
public final void
protected void
private void
beforeStatement(String statementName, int statementType)

private void
public final void
public final void
public final void
public final void
public final void
public final void
public final void
count(AST _t)

protected AST
createFromElement(String path, AST alias, AST propertyFetch)

protected AST
createFromFilterElement(AST filterEntity, AST alias)

protected void
createFromJoinElement(AST path, AST alias, int joinType, AST fetch, AST propertyFetch, AST with)

protected AST
createIntoClause(String path, AST propertySpec)

public final void
protected void
public final void
expr(AST _t)

public final void
public final void
public final void
public final void
public final void
protected AST
generateNamedParameter(AST delimiterNode, AST nameNode)

protected AST
public final int
public final int
public final int
public final int
public final void
private void
handleClauseStart(int clauseType)

protected void
handleResultVariableRef(AST resultVariableRef)

public final void
public final void
inRhs(AST _t)

public final void
public final void
public final void
public final boolean
public final boolean
public final boolean
public final boolean
public final boolean
protected boolean
protected boolean
public final boolean
public final boolean
public final void
public final int
public final void
public final void
protected void
protected AST
protected AST
lookupProperty(AST dot, boolean root, boolean inSelect)

public final void
public final void
private static final long[]
private static final long[]
public final void
public final void
public final void
public final void
public final void
public final void
public final String
path(AST _t)

public final void
protected void
protected void
protected void
protected void
protected void
prepareFromClauseInputTree(AST fromClauseInput)

Pre-process the from clause input tree.

protected void
protected void
prepareVersioned(AST updateNode, AST versionedNode)

protected void
processAggregation(AST node, boolean inSelect)

protected void
processBoolean(AST constant)

protected void
processConstant(AST constant)

protected void
processConstructor(AST constructor)

protected void
processFunction(AST functionCall, boolean inSelect)

protected void
processIndex(AST indexOp)

protected void
protected void
protected void
processQuery(AST select, AST query)

public final void
public final void
public final void
protected void
pushFromClause(AST fromClause, AST inputFromNode)

Sets the current 'FROM' context.

public final void
query(AST _t)

protected void
resolve(AST node)

protected void
public final void
public final void
public final void
public final void
public final void
protected void
setAlias(AST selectExpr, AST ident)

public final void
protected void
setImpliedJoinType(int joinType)

public final void
public final void
protected void
public final void
public final void
Inherited from antlr.TreeParser:
getASTgetASTFactorygetTokenNamegetTokenNamesmatchmatchmatchNotpanicreportErrorreportErrorreportWarningsetASTFactorysetASTNodeClasssetASTNodeTypetraceIntraceIndenttraceOut

Field Detail

_tokenNamesback to summary
public static final String[] _tokenNames
_tokenSet_0back to summary
public static final BitSet _tokenSet_0
_tokenSet_1back to summary
public static final BitSet _tokenSet_1
currentClauseTypeback to summary
private int currentClauseType
currentStatementTypeback to summary
private int currentStatementType
currentTopLevelClauseTypeback to summary
private int currentTopLevelClauseType
inCaseback to summary
private boolean inCase
inFromback to summary
private boolean inFrom
inFunctionCallback to summary
private boolean inFunctionCall
inSelectback to summary
private boolean inSelect
levelback to summary
private int level
logback to summary
private static Logger log
statementTypeback to summary
private int statementType
statementTypeNameback to summary
private String statementTypeName

Constructor Detail

HqlSqlBaseWalkerback to summary
public HqlSqlBaseWalker()

Method Detail

addrExprback to summary
public final void addrExpr(AST _t, boolean root) throws RecognitionException
addrExprLhsback to summary
public final void addrExprLhs(AST _t) throws RecognitionException
afterStatementCompletionback to summary
private void afterStatementCompletion(String statementName)
aggregateExprback to summary
public final void aggregateExpr(AST _t) throws RecognitionException
aliasedSelectExprback to summary
public final void aliasedSelectExpr(AST _t) throws RecognitionException
aliasRefback to summary
public final void aliasRef(AST _t) throws RecognitionException
arithmeticExprback to summary
public final void arithmeticExpr(AST _t) throws RecognitionException
assignmentback to summary
public final void assignment(AST _t) throws RecognitionException
beforeSelectClauseback to summary
protected void beforeSelectClause() throws SemanticException
beforeStatementback to summary
private void beforeStatement(String statementName, int statementType)
beforeStatementCompletionback to summary
private void beforeStatementCompletion(String statementName)
caseExprback to summary
public final void caseExpr(AST _t) throws RecognitionException
collectionFunctionback to summary
public final void collectionFunction(AST _t) throws RecognitionException
collectionFunctionOrSubselectback to summary
public final void collectionFunctionOrSubselect(AST _t) throws RecognitionException
comparisonExprback to summary
public final void comparisonExpr(AST _t) throws RecognitionException
constantback to summary
public final void constant(AST _t) throws RecognitionException
constructorback to summary
public final void constructor(AST _t) throws RecognitionException
countback to summary
public final void count(AST _t) throws RecognitionException
createFromElementback to summary
protected AST createFromElement(String path, AST alias, AST propertyFetch) throws SemanticException
createFromFilterElementback to summary
protected AST createFromFilterElement(AST filterEntity, AST alias) throws SemanticException
createFromJoinElementback to summary
protected void createFromJoinElement(AST path, AST alias, int joinType, AST fetch, AST propertyFetch, AST with) throws SemanticException
createIntoClauseback to summary
protected AST createIntoClause(String path, AST propertySpec) throws SemanticException
deleteStatementback to summary
public final void deleteStatement(AST _t) throws RecognitionException
evaluateAssignmentback to summary
protected void evaluateAssignment(AST eq) throws SemanticException
exprback to summary
public final void expr(AST _t) throws RecognitionException
exprOrSubqueryback to summary
public final void exprOrSubquery(AST _t) throws RecognitionException
fromClauseback to summary
public final void fromClause(AST _t) throws RecognitionException
fromElementback to summary
public final void fromElement(AST _t) throws RecognitionException
fromElementListback to summary
public final void fromElementList(AST _t) throws RecognitionException
functionCallback to summary
public final void functionCall(AST _t) throws RecognitionException
generateNamedParameterback to summary
protected AST generateNamedParameter(AST delimiterNode, AST nameNode) throws SemanticException
generatePositionalParameterback to summary
protected AST generatePositionalParameter(AST inputNode) throws SemanticException
getCurrentClauseTypeback to summary
public final int getCurrentClauseType()
getCurrentStatementTypeback to summary
public final int getCurrentStatementType()
getCurrentTopLevelClauseTypeback to summary
public final int getCurrentTopLevelClauseType()
getStatementTypeback to summary
public final int getStatementType()
groupClauseback to summary
public final void groupClause(AST _t) throws RecognitionException
handleClauseStartback to summary
private void handleClauseStart(int clauseType)
handleResultVariableRefback to summary
protected void handleResultVariableRef(AST resultVariableRef) throws SemanticException
identifierback to summary
public final void identifier(AST _t) throws RecognitionException
inRhsback to summary
public final void inRhs(AST _t) throws RecognitionException
insertablePropertySpecback to summary
public final void insertablePropertySpec(AST _t) throws RecognitionException
insertStatementback to summary
public final void insertStatement(AST _t) throws RecognitionException
intoClauseback to summary
public final void intoClause(AST _t) throws RecognitionException
isComparativeExpressionClauseback to summary
public final boolean isComparativeExpressionClause()
isInCaseback to summary
public final boolean isInCase()
isInFromback to summary
public final boolean isInFrom()
isInFunctionCallback to summary
public final boolean isInFunctionCall()
isInSelectback to summary
public final boolean isInSelect()
isNonQualifiedPropertyRefback to summary
protected boolean isNonQualifiedPropertyRef(AST ident)
isOrderExpressionResultVariableRefback to summary
protected boolean isOrderExpressionResultVariableRef(AST ident) throws SemanticException
isSelectStatementback to summary
public final boolean isSelectStatement()
isSubQueryback to summary
public final boolean isSubQuery()
joinElementback to summary
public final void joinElement(AST _t) throws RecognitionException
joinTypeback to summary
public final int joinType(AST _t) throws RecognitionException
literalback to summary
public final void literal(AST _t) throws RecognitionException
logicalExprback to summary
public final void logicalExpr(AST _t) throws RecognitionException
lookupAliasback to summary
protected void lookupAlias(AST ident) throws SemanticException
lookupNonQualifiedPropertyback to summary
protected AST lookupNonQualifiedProperty(AST property) throws SemanticException
lookupPropertyback to summary
protected AST lookupProperty(AST dot, boolean root, boolean inSelect) throws SemanticException
mapComponentReferenceback to summary
public final void mapComponentReference(AST _t) throws RecognitionException
mapPropertyExpressionback to summary
public final void mapPropertyExpression(AST _t) throws RecognitionException
mk_tokenSet_0back to summary
private static final long[] mk_tokenSet_0()
mk_tokenSet_1back to summary
private static final long[] mk_tokenSet_1()
newValueback to summary
public final void newValue(AST _t) throws RecognitionException
numericIntegerback to summary
public final void numericInteger(AST _t) throws RecognitionException
orderClauseback to summary
public final void orderClause(AST _t) throws RecognitionException
orderExprback to summary
public final void orderExpr(AST _t) throws RecognitionException
orderExprsback to summary
public final void orderExprs(AST _t) throws RecognitionException
parameterback to summary
public final void parameter(AST _t) throws RecognitionException
pathback to summary
public final String path(AST _t) throws RecognitionException
pathAsIdentback to summary
public final void pathAsIdent(AST _t) throws RecognitionException
postProcessDeleteback to summary
protected void postProcessDelete(AST delete) throws SemanticException
postProcessInsertback to summary
protected void postProcessInsert(AST insert) throws SemanticException
postProcessUpdateback to summary
protected void postProcessUpdate(AST update) throws SemanticException
prepareArithmeticOperatorback to summary
protected void prepareArithmeticOperator(AST operator) throws SemanticException
prepareFromClauseInputTreeback to summary
protected void prepareFromClauseInputTree(AST fromClauseInput)

Pre-process the from clause input tree.

prepareLogicOperatorback to summary
protected void prepareLogicOperator(AST operator) throws SemanticException
prepareVersionedback to summary
protected void prepareVersioned(AST updateNode, AST versionedNode) throws SemanticException
processAggregationback to summary
protected void processAggregation(AST node, boolean inSelect) throws SemanticException
processBooleanback to summary
protected void processBoolean(AST constant) throws SemanticException
processConstantback to summary
protected void processConstant(AST constant) throws SemanticException
processConstructorback to summary
protected void processConstructor(AST constructor) throws SemanticException
processFunctionback to summary
protected void processFunction(AST functionCall, boolean inSelect) throws SemanticException
processIndexback to summary
protected void processIndex(AST indexOp) throws SemanticException
processMapComponentReferenceback to summary
protected void processMapComponentReference(AST node) throws SemanticException
processNumericLiteralback to summary
protected void processNumericLiteral(AST literal) throws SemanticException
processQueryback to summary
protected void processQuery(AST select, AST query) throws SemanticException
propertyNameback to summary
public final void propertyName(AST _t) throws RecognitionException
propertyRefback to summary
public final void propertyRef(AST _t) throws RecognitionException
propertyRefLhsback to summary
public final void propertyRefLhs(AST _t) throws RecognitionException
pushFromClauseback to summary
protected void pushFromClause(AST fromClause, AST inputFromNode)

Sets the current 'FROM' context.

queryback to summary
public final void query(AST _t) throws RecognitionException
resolveback to summary
protected void resolve(AST node) throws SemanticException
resolveSelectExpressionback to summary
protected void resolveSelectExpression(AST dotNode) throws SemanticException
resultVariableRefback to summary
public final void resultVariableRef(AST _t) throws RecognitionException
selectClauseback to summary
public final void selectClause(AST _t) throws RecognitionException
selectExprback to summary
public final void selectExpr(AST _t) throws RecognitionException
selectExprListback to summary
public final void selectExprList(AST _t) throws RecognitionException
selectStatementback to summary
public final void selectStatement(AST _t) throws RecognitionException
setAliasback to summary
protected void setAlias(AST selectExpr, AST ident)
setClauseback to summary
public final void setClause(AST _t) throws RecognitionException
setImpliedJoinTypeback to summary
protected void setImpliedJoinType(int joinType)
statementback to summary
public final void statement(AST _t) throws RecognitionException
updateStatementback to summary
public final void updateStatement(AST _t) throws RecognitionException
validateMapPropertyExpressionback to summary
protected void validateMapPropertyExpression(AST node) throws SemanticException
whereClauseback to summary
public final void whereClause(AST _t) throws RecognitionException
withClauseback to summary
public final void withClause(AST _t) throws RecognitionException