Top Description Inners Fields Constructors Methods
org.hibernate.hql.ast

public Class HqlSqlWalker

extends HqlSqlBaseWalker
implements ErrorReporter, NamedParameterSource
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.ParameterBinder.NamedParameterSource, org.hibernate.hql.ast.ErrorReporter
Imports
java.io.Serializable, java.util.ArrayList, .Calendar, .Date, .HashMap, .HashSet, .Iterator, .List, .Map, .Set, .Arrays, org.slf4j.Logger, .LoggerFactory, org.hibernate.QueryException, .HibernateException, org.hibernate.engine.JoinSequence, .ParameterBinder, .SessionFactoryImplementor, org.hibernate.hql.QueryTranslator, org.hibernate.hql.antlr.HqlSqlBaseWalker, .HqlSqlTokenTypes, .HqlTokenTypes, .SqlTokenTypes, org.hibernate.hql.ast.tree.AggregateNode, .AssignmentSpecification, .CollectionFunction, .ConstructorNode, .DeleteStatement, .DotNode, .FromClause, .FromElement, .FromReferenceNode, .IdentNode, .IndexNode, .InsertStatement, .IntoClause, .MethodNode, .ParameterNode, .QueryNode, .ResolvableNode, .RestrictableStatement, .ResultVariableRefNode, .SelectClause, .SelectExpression, .UpdateStatement, .OperatorNode, .ParameterContainer, .FromElementFactory, org.hibernate.hql.ast.util.ASTPrinter, .ASTUtil, .AliasGenerator, .JoinProcessor, .LiteralProcessor, .SessionFactoryHelper, .SyntheticAndFactory, .NodeTraverser, org.hibernate.id.IdentifierGenerator, .PostInsertIdentifierGenerator, .SequenceGenerator, org.hibernate.param.NamedParameterSpecification, .ParameterSpecification, .PositionalParameterSpecification, .VersionTypeSeedParameterSpecification, .CollectionFilterKeyParameterSpecification, org.hibernate.persister.collection.QueryableCollection, org.hibernate.persister.entity.Queryable, org.hibernate.sql.JoinFragment, org.hibernate.type.AssociationType, .Type, .VersionType, .DbTimestampType, .ComponentType, org.hibernate.usertype.UserVersionType, org.hibernate.util.ArrayHelper, .StringHelper, antlr.ASTFactory, .RecognitionException, .SemanticException, antlr.collections.AST

Implements methods used by the HQL->SQL tree transform grammar (a.k.a. the second phase).
See Also
SqlASTFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final AliasGenerator
private ArrayList<E>
private final String
private FromClause
private final HqlParser
private int
private final LiteralProcessor
private static final Logger
private Map<K, V>
private int
private int
private ArrayList<E>
private final ParseErrorHandler
private int
private final ASTPrinter
private Set<E>
private final QueryTranslatorImpl
private SelectClause
private Map<String, SelectExpression>
selectExpressionsByResultVariable

Maps each top-level result variable to its SelectExpression; (excludes result variables defined in subqueries)

private final SessionFactoryHelper
private final Map<K, V>
private final boolean
private int
Inherited from org.hibernate.hql.antlr.HqlSqlBaseWalker:
_tokenNames_tokenSet_0_tokenSet_1

Constructor Summary

AccessConstructor and Description
public
HqlSqlWalker(QueryTranslatorImpl
Back pointer to the query translator implementation that is using this tree transform.
qti
,
SessionFactoryImplementor
The session factory implementor where the Hibernate mappings can be found.
sfi
,
HqlParser
A reference to the phase-1 parser
parser
,
Map<K, V>
Registers the token replacement map with the walker. This map will be used to substitute function names and constants.
tokenReplacements
,
String
The collection role name of the collection used as the basis for the filter, NULL if this is not a collection filter compilation.
collectionRole
)

Create a new tree transformer.

Method Summary

Modifier and TypeMethod and Description
public void
protected void
private String
protected AST
protected AST
protected void
createFromJoinElement(AST path, AST alias, int joinType, AST fetchNode, AST propertyFetch, AST with)

Overrides org.hibernate.hql.antlr.HqlSqlBaseWalker.createFromJoinElement.

protected AST
private void
protected void
private void
evaluateAssignment(AST eq, Queryable persister, int targetIndex)

protected AST
protected AST
private AST
generateSyntheticDotNodeForNonQualifiedPropertyRef(AST property, FromElement fromElement)

Deprecated as a consequence of FromElement being deprecated.
private AST
public AliasGenerator
public ArrayList<E>
public ASTPrinter
public String
public FromClause
public Map<K, V>
public FromClause
public int
public LiteralProcessor
public int[]
getNamedParameterLocations(String name)

Implements org.hibernate.engine.ParameterBinder.NamedParameterSource.getNamedParameterLocations.

Returns the locations of all occurrences of the named parameter.
public int
public ArrayList<E>
public ParseErrorHandler
public Set<E>

Returns:

A set of table names (Strings).
getQuerySpaces
()

Returns the set of unique query spaces (a.k.a. table names) that occurred in the query.

public String[]
public Type[]
public SelectClause
public SessionFactoryHelper
public Map<K, V>
protected void
private void
handleWithFragment(FromElement fromElement, AST hqlWithNode)

Deprecated as a consequence of FromElement being deprecated.
private boolean
public boolean
private boolean
protected boolean
protected boolean
public boolean
private boolean
protected void
protected AST
protected AST
lookupProperty(AST dot, boolean root, boolean inSelect)

Overrides org.hibernate.hql.antlr.HqlSqlBaseWalker.lookupProperty.

public static void
private void
popFromClause()

Returns to the previous 'FROM' context.

protected void
protected void
protected void
protected void
protected void
protected void
prepareFromClauseInputTree(AST fromClauseInput)

Overrides org.hibernate.hql.antlr.HqlSqlBaseWalker.prepareFromClauseInputTree.

Pre-process the from clause input tree.
protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
pushFromClause(AST
The new 'FROM' context.
fromNode
,
AST
The from node from the input AST.
inputFromNode
)

Overrides org.hibernate.hql.antlr.HqlSqlBaseWalker.pushFromClause.

Sets the current 'FROM' context.
public void
reportError(RecognitionException e)

Overrides antlr.TreeParser.reportError.

Implements org.hibernate.hql.ast.ErrorReporter.reportError.

Parser error-reporting function can be overridden in subclass
public void
reportError(String s)

Overrides antlr.TreeParser.reportError.

Implements org.hibernate.hql.ast.ErrorReporter.reportError.

Parser error-reporting function can be overridden in subclass
public void
reportWarning(String s)

Overrides antlr.TreeParser.reportWarning.

Implements org.hibernate.hql.ast.ErrorReporter.reportWarning.

Parser warning-reporting function can be overridden in subclass
protected void
protected void
protected void
protected void
public static boolean
public void
traceIn(String ruleName, AST tree)

Overrides antlr.TreeParser.traceIn.

public void
traceOut(String ruleName, AST tree)

Overrides antlr.TreeParser.traceOut.

private void
private void
protected void
Inherited from org.hibernate.hql.antlr.HqlSqlBaseWalker:
addrExpraddrExprLhsaggregateExpraliasedSelectExpraliasRefarithmeticExprassignmentcaseExprcollectionFunctioncollectionFunctionOrSubselectcomparisonExprconstantconstructorcountdeleteStatementexprexprOrSubqueryfromClausefromElementfromElementListfunctionCallgetCurrentClauseTypegetCurrentStatementTypegetCurrentTopLevelClauseTypegetStatementTypegroupClauseidentifierinRhsinsertablePropertySpecinsertStatementintoClauseisComparativeExpressionClauseisInCaseisInFromisInFunctionCallisInSelectisSelectStatementisSubQueryjoinElementjoinTypeliterallogicalExprmapComponentReferencemapPropertyExpressionnewValuenumericIntegerorderClauseorderExprorderExprsparameterpathpathAsIdentprocessMapComponentReferencepropertyNamepropertyRefpropertyRefLhsqueryresultVariableRefselectClauseselectExprselectExprListselectStatementsetClausestatementupdateStatementwhereClausewithClause