org.hibernate.hql.ast.tree

Class FromReferenceNode

Implemented Interfaces:
DisplayableNode, InitializeableNode, PathNode, ResolvableNode, SelectExpression
Known Direct Subclasses:
DotNode, IdentNode, IndexNode, SelectExpressionImpl

public abstract class FromReferenceNode
extends AbstractSelectExpression
implements ResolvableNode, DisplayableNode, InitializeableNode, PathNode

Represents a reference to a FROM element, for example a class alias in a WHERE clause.
Author:
josh Jul 21, 2004 7:02:04 AM

Field Summary

static int
ROOT_LEVEL

Method Summary

String
getDisplayText()
Returns additional display text for the AST node.
FromElement
getFromElement()
Returns the FROM element that this expression refers to.
FromElement
getImpliedJoin()
Sub-classes can override this method if they produce implied joins (e.g.
String
getPath()
Returns the full path name represented by the node.
boolean
isResolved()
boolean
isReturnableEntity()
Returns true if this select expression represents an entity that can be returned.
void
prepareForDot(String propertyName)
void
recursiveResolve(int level, boolean impliedAtRoot, String classAlias)
void
recursiveResolve(int level, boolean impliedAtRoot, String classAlias, AST parent)
void
resolve(boolean generateJoin, boolean implicitJoin)
Does the work of resolving an identifier or a dot, but without a parent node or alias
void
resolve(boolean generateJoin, boolean implicitJoin, String classAlias)
Does the work of resolving an identifier or a dot, but without a parent node
void
resolveFirstChild()
Resolves the left hand side of the DOT.
void
resolveInFunctionCall(boolean generateJoin, boolean implicitJoin)
Does the work of resolving inside of the scope of a function call
void
setFromElement(FromElement fromElement)
void
setResolved()

Methods inherited from class org.hibernate.hql.ast.tree.AbstractSelectExpression

getAlias, getFromElement, isConstructor, isReturnableEntity, isScalar, setAlias

Methods inherited from class org.hibernate.hql.ast.tree.HqlSqlWalkerNode

getASTFactory, getAliasGenerator, getSessionFactoryHelper, getWalker, initialize

Methods inherited from class org.hibernate.hql.ast.tree.SqlNode

getDataType, getOriginalText, setDataType, setText

Methods inherited from class org.hibernate.hql.ast.tree.Node

getColumn, getFilename, getLine, getRenderText, getTextLength, initialize, initialize

Field Details

ROOT_LEVEL

public static final int ROOT_LEVEL
Field Value:
0

Method Details

getDisplayText

public String getDisplayText()
Returns additional display text for the AST node.
Specified by:
getDisplayText in interface DisplayableNode
Returns:
String - The additional display text.

getFromElement

public FromElement getFromElement()
Returns the FROM element that this expression refers to.
Specified by:
getFromElement in interface SelectExpression
Overrides:
getFromElement in interface AbstractSelectExpression
Returns:
The FROM element.

getImpliedJoin

public FromElement getImpliedJoin()
Sub-classes can override this method if they produce implied joins (e.g. DotNode).
Returns:
an implied join created by this from reference.

getPath

public String getPath()
Returns the full path name represented by the node.
Specified by:
getPath in interface PathNode
Returns:
the full path name represented by the node.

isResolved

public boolean isResolved()

isReturnableEntity

public boolean isReturnableEntity()
            throws SemanticException
Returns true if this select expression represents an entity that can be returned.
Specified by:
isReturnableEntity in interface SelectExpression
Overrides:
isReturnableEntity in interface AbstractSelectExpression
Returns:
true if this select expression represents an entity that can be returned.

prepareForDot

public void prepareForDot(String propertyName)
            throws SemanticException

recursiveResolve

public void recursiveResolve(int level,
                             boolean impliedAtRoot,
                             String classAlias)
            throws SemanticException

recursiveResolve

public void recursiveResolve(int level,
                             boolean impliedAtRoot,
                             String classAlias,
                             AST parent)
            throws SemanticException

resolve

public void resolve(boolean generateJoin,
                    boolean implicitJoin)
            throws SemanticException
Does the work of resolving an identifier or a dot, but without a parent node or alias
Specified by:
resolve in interface ResolvableNode

resolve

public void resolve(boolean generateJoin,
                    boolean implicitJoin,
                    String classAlias)
            throws SemanticException
Does the work of resolving an identifier or a dot, but without a parent node
Specified by:
resolve in interface ResolvableNode

resolveFirstChild

public void resolveFirstChild()
            throws SemanticException
Resolves the left hand side of the DOT.

resolveInFunctionCall

public void resolveInFunctionCall(boolean generateJoin,
                                  boolean implicitJoin)
            throws SemanticException
Does the work of resolving inside of the scope of a function call
Specified by:
resolveInFunctionCall in interface ResolvableNode

setFromElement

public void setFromElement(FromElement fromElement)

setResolved

public void setResolved()