|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectantlr.TreeParser
org.hibernate.hql.antlr.HqlSqlBaseWalker
org.hibernate.hql.ast.HqlSqlWalker
public class HqlSqlWalker
Implements methods used by the HQL->SQL tree transform grammar (a.k.a. the second phase).
SqlASTFactory| Field Summary |
|---|
| Fields inherited from class org.hibernate.hql.antlr.HqlSqlBaseWalker |
|---|
_tokenNames, _tokenSet_0 |
| Fields inherited from class antlr.TreeParser |
|---|
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames, traceDepth |
| Constructor Summary | |
|---|---|
HqlSqlWalker(QueryTranslatorImpl qti,
SessionFactoryImplementor sfi,
HqlParser parser,
Map tokenReplacements,
String collectionRole)
Create a new tree transformer. |
|
| Method Summary | |
|---|---|
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 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()
|
FromClause |
getCurrentFromClause()
|
Map |
getEnabledFilters()
|
FromClause |
getFinalFromClause()
|
int |
getImpliedJoinType()
|
LiteralProcessor |
getLiteralProcessor()
|
int[] |
getNamedParameterLocations(String name)
Returns the locations of all occurrences of the named parameter. |
int |
getNumberOfParametersInSetClause()
|
ArrayList |
getParameters()
|
ParseErrorHandler |
getParseErrorHandler()
|
Set |
getQuerySpaces()
Returns the set of unique query spaces (a.k.a. |
String[] |
getReturnAliases()
|
Type[] |
getReturnTypes()
|
SelectClause |
getSelectClause()
|
SessionFactoryHelper |
getSessionFactoryHelper()
|
Map |
getTokenReplacements()
|
boolean |
isFilter()
|
protected boolean |
isNonQualifiedPropertyRef(antlr.collections.AST ident)
|
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 |
processBoolean(antlr.collections.AST constant)
|
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)
|
static boolean |
supportsIdGenWithBulkInsertion(IdentifierGenerator generator)
|
| Methods inherited from class antlr.TreeParser |
|---|
getAST, getASTFactory, getTokenName, getTokenNames, match, match, matchNot, setASTFactory, setASTNodeClass, setASTNodeType, traceIn, traceIndent, traceOut |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public 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.| Method Detail |
|---|
protected void prepareFromClauseInputTree(antlr.collections.AST fromClauseInput)
HqlSqlBaseWalker
prepareFromClauseInputTree in class HqlSqlBaseWalkerpublic boolean isFilter()
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 getQuerySpaces()
protected antlr.collections.AST createFromElement(String path,
antlr.collections.AST alias,
antlr.collections.AST propertyFetch)
throws antlr.SemanticException
createFromElement in class HqlSqlBaseWalkerantlr.SemanticException
protected antlr.collections.AST createFromFilterElement(antlr.collections.AST filterEntity,
antlr.collections.AST alias)
throws antlr.SemanticException
createFromFilterElement in class HqlSqlBaseWalkerantlr.SemanticException
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)
throws antlr.SemanticException
createFromJoinElement in class HqlSqlBaseWalkerantlr.SemanticException
protected 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 int 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 HqlSqlBaseWalker
protected antlr.collections.AST lookupNonQualifiedProperty(antlr.collections.AST property)
throws antlr.SemanticException
lookupNonQualifiedProperty in class HqlSqlBaseWalkerantlr.SemanticException
protected void processQuery(antlr.collections.AST select,
antlr.collections.AST query)
throws antlr.SemanticException
processQuery in class HqlSqlBaseWalkerantlr.SemanticException
protected void postProcessDML(RestrictableStatement statement)
throws antlr.SemanticException
antlr.SemanticException
protected void postProcessUpdate(antlr.collections.AST update)
throws antlr.SemanticException
postProcessUpdate in class HqlSqlBaseWalkerantlr.SemanticException
protected void postProcessDelete(antlr.collections.AST delete)
throws antlr.SemanticException
postProcessDelete in class HqlSqlBaseWalkerantlr.SemanticExceptionpublic static boolean supportsIdGenWithBulkInsertion(IdentifierGenerator generator)
protected void postProcessInsert(antlr.collections.AST insert)
throws antlr.SemanticException,
QueryException
postProcessInsert in class HqlSqlBaseWalkerantlr.SemanticException
QueryException
protected void resolve(antlr.collections.AST node)
throws antlr.SemanticException
resolve in class HqlSqlBaseWalkerantlr.SemanticException
protected void resolveSelectExpression(antlr.collections.AST node)
throws antlr.SemanticException
resolveSelectExpression in class HqlSqlBaseWalkerantlr.SemanticException
protected void beforeSelectClause()
throws antlr.SemanticException
beforeSelectClause in class HqlSqlBaseWalkerantlr.SemanticException
protected antlr.collections.AST generatePositionalParameter(antlr.collections.AST inputNode)
throws antlr.SemanticException
generatePositionalParameter in class HqlSqlBaseWalkerantlr.SemanticException
protected antlr.collections.AST generateNamedParameter(antlr.collections.AST delimiterNode,
antlr.collections.AST nameNode)
throws antlr.SemanticException
generateNamedParameter in class HqlSqlBaseWalkerantlr.SemanticException
protected void processConstant(antlr.collections.AST constant)
throws antlr.SemanticException
processConstant in class HqlSqlBaseWalkerantlr.SemanticException
protected void processBoolean(antlr.collections.AST constant)
throws antlr.SemanticException
processBoolean in class HqlSqlBaseWalkerantlr.SemanticExceptionprotected void processNumericLiteral(antlr.collections.AST literal)
processNumericLiteral in class HqlSqlBaseWalker
protected void processIndex(antlr.collections.AST indexOp)
throws antlr.SemanticException
processIndex in class HqlSqlBaseWalkerantlr.SemanticException
protected void processFunction(antlr.collections.AST functionCall,
boolean inSelect)
throws antlr.SemanticException
processFunction in class HqlSqlBaseWalkerantlr.SemanticException
protected void processConstructor(antlr.collections.AST constructor)
throws antlr.SemanticException
processConstructor in class HqlSqlBaseWalkerantlr.SemanticException
protected void setAlias(antlr.collections.AST selectExpr,
antlr.collections.AST ident)
setAlias in class HqlSqlBaseWalker
public int[] getNamedParameterLocations(String name)
throws QueryException
getNamedParameterLocations in interface ParameterBinder.NamedParameterSourceQueryExceptionpublic 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 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.SemanticException
protected void prepareVersioned(antlr.collections.AST updateNode,
antlr.collections.AST versioned)
throws antlr.SemanticException
prepareVersioned in class HqlSqlBaseWalkerantlr.SemanticException
protected void prepareLogicOperator(antlr.collections.AST operator)
throws antlr.SemanticException
prepareLogicOperator in class HqlSqlBaseWalkerantlr.SemanticException
protected void prepareArithmeticOperator(antlr.collections.AST operator)
throws antlr.SemanticException
prepareArithmeticOperator in class HqlSqlBaseWalkerantlr.SemanticExceptionpublic static void panic()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||