|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object antlr.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 HqlSqlBaseWalker
public 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 ErrorReporter
reportError
in class antlr.TreeParser
public void reportError(String s)
reportError
in interface ErrorReporter
reportError
in class antlr.TreeParser
public void reportWarning(String s)
reportWarning
in interface ErrorReporter
reportWarning
in class antlr.TreeParser
public Set getQuerySpaces()
protected antlr.collections.AST createFromElement(String path, antlr.collections.AST alias, antlr.collections.AST propertyFetch) throws antlr.SemanticException
createFromElement
in class HqlSqlBaseWalker
antlr.SemanticException
protected antlr.collections.AST createFromFilterElement(antlr.collections.AST filterEntity, antlr.collections.AST alias) throws antlr.SemanticException
createFromFilterElement
in class HqlSqlBaseWalker
antlr.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 HqlSqlBaseWalker
antlr.SemanticException
protected void pushFromClause(antlr.collections.AST fromNode, antlr.collections.AST inputFromNode)
pushFromClause
in class HqlSqlBaseWalker
fromNode
- 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 HqlSqlBaseWalker
antlr.SemanticException
protected void setImpliedJoinType(int joinType)
setImpliedJoinType
in class HqlSqlBaseWalker
public int getImpliedJoinType()
protected antlr.collections.AST lookupProperty(antlr.collections.AST dot, boolean root, boolean inSelect) throws antlr.SemanticException
lookupProperty
in class HqlSqlBaseWalker
antlr.SemanticException
protected 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 HqlSqlBaseWalker
antlr.SemanticException
protected void processQuery(antlr.collections.AST select, antlr.collections.AST query) throws antlr.SemanticException
processQuery
in class HqlSqlBaseWalker
antlr.SemanticException
protected void postProcessDML(RestrictableStatement statement) throws antlr.SemanticException
antlr.SemanticException
protected void postProcessUpdate(antlr.collections.AST update) throws antlr.SemanticException
postProcessUpdate
in class HqlSqlBaseWalker
antlr.SemanticException
protected void postProcessDelete(antlr.collections.AST delete) throws antlr.SemanticException
postProcessDelete
in class HqlSqlBaseWalker
antlr.SemanticException
public static boolean supportsIdGenWithBulkInsertion(IdentifierGenerator generator)
protected void postProcessInsert(antlr.collections.AST insert) throws antlr.SemanticException, QueryException
postProcessInsert
in class HqlSqlBaseWalker
antlr.SemanticException
QueryException
protected void resolve(antlr.collections.AST node) throws antlr.SemanticException
resolve
in class HqlSqlBaseWalker
antlr.SemanticException
protected void resolveSelectExpression(antlr.collections.AST node) throws antlr.SemanticException
resolveSelectExpression
in class HqlSqlBaseWalker
antlr.SemanticException
protected void beforeSelectClause() throws antlr.SemanticException
beforeSelectClause
in class HqlSqlBaseWalker
antlr.SemanticException
protected antlr.collections.AST generatePositionalParameter(antlr.collections.AST inputNode) throws antlr.SemanticException
generatePositionalParameter
in class HqlSqlBaseWalker
antlr.SemanticException
protected antlr.collections.AST generateNamedParameter(antlr.collections.AST delimiterNode, antlr.collections.AST nameNode) throws antlr.SemanticException
generateNamedParameter
in class HqlSqlBaseWalker
antlr.SemanticException
protected void processConstant(antlr.collections.AST constant) throws antlr.SemanticException
processConstant
in class HqlSqlBaseWalker
antlr.SemanticException
protected void processBoolean(antlr.collections.AST constant) throws antlr.SemanticException
processBoolean
in class HqlSqlBaseWalker
antlr.SemanticException
protected void processNumericLiteral(antlr.collections.AST literal)
processNumericLiteral
in class HqlSqlBaseWalker
protected void processIndex(antlr.collections.AST indexOp) throws antlr.SemanticException
processIndex
in class HqlSqlBaseWalker
antlr.SemanticException
protected void processFunction(antlr.collections.AST functionCall, boolean inSelect) throws antlr.SemanticException
processFunction
in class HqlSqlBaseWalker
antlr.SemanticException
protected void processConstructor(antlr.collections.AST constructor) throws antlr.SemanticException
processConstructor
in class HqlSqlBaseWalker
antlr.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.NamedParameterSource
QueryException
public 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 HqlSqlBaseWalker
antlr.SemanticException
public ArrayList getAssignmentSpecifications()
protected antlr.collections.AST createIntoClause(String path, antlr.collections.AST propertySpec) throws antlr.SemanticException
createIntoClause
in class HqlSqlBaseWalker
antlr.SemanticException
protected void prepareVersioned(antlr.collections.AST updateNode, antlr.collections.AST versioned) throws antlr.SemanticException
prepareVersioned
in class HqlSqlBaseWalker
antlr.SemanticException
protected void prepareLogicOperator(antlr.collections.AST operator) throws antlr.SemanticException
prepareLogicOperator
in class HqlSqlBaseWalker
antlr.SemanticException
protected void prepareArithmeticOperator(antlr.collections.AST operator) throws antlr.SemanticException
prepareArithmeticOperator
in class HqlSqlBaseWalker
antlr.SemanticException
public static void panic()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |