org.hibernate.hql.ast.tree
Class FromReferenceNode

java.lang.Object
  extended by antlr.BaseAST
      extended by antlr.CommonAST
          extended by org.hibernate.hql.ast.tree.Node
              extended by org.hibernate.hql.ast.tree.SqlNode
                  extended by org.hibernate.hql.ast.tree.HqlSqlWalkerNode
                      extended by org.hibernate.hql.ast.tree.AbstractSelectExpression
                          extended by org.hibernate.hql.ast.tree.FromReferenceNode
All Implemented Interfaces:
antlr.collections.AST, Serializable, DisplayableNode, InitializeableNode, PathNode, ResolvableNode, SelectExpression
Direct Known 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
See Also:
Serialized Form

Field Summary
static int ROOT_LEVEL
           
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
FromReferenceNode()
           
 
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, antlr.collections.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, isConstructor, isScalar, setAlias
 
Methods inherited from class org.hibernate.hql.ast.tree.HqlSqlWalkerNode
getAliasGenerator, getASTFactory, 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
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, setType
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toString, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.hibernate.hql.ast.tree.ResolvableNode
resolve, resolveIndex
 
Methods inherited from interface org.hibernate.hql.ast.tree.InitializeableNode
initialize
 
Methods inherited from interface org.hibernate.hql.ast.tree.SelectExpression
getDataType, setScalarColumnText, setText
 

Field Detail

ROOT_LEVEL

public static final int ROOT_LEVEL
See Also:
Constant Field Values
Constructor Detail

FromReferenceNode

public FromReferenceNode()
Method Detail

getFromElement

public FromElement getFromElement()
Description copied from interface: SelectExpression
Returns the FROM element that this expression refers to.

Specified by:
getFromElement in interface SelectExpression
Overrides:
getFromElement in class AbstractSelectExpression
Returns:
The FROM element.

setFromElement

public void setFromElement(FromElement fromElement)

resolveFirstChild

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

Throws:
antlr.SemanticException

getPath

public String getPath()
Description copied from interface: PathNode
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()

setResolved

public void setResolved()

getDisplayText

public String getDisplayText()
Description copied from interface: DisplayableNode
Returns additional display text for the AST node.

Specified by:
getDisplayText in interface DisplayableNode
Returns:
String - The additional display text.

recursiveResolve

public void recursiveResolve(int level,
                             boolean impliedAtRoot,
                             String classAlias)
                      throws antlr.SemanticException
Throws:
antlr.SemanticException

recursiveResolve

public void recursiveResolve(int level,
                             boolean impliedAtRoot,
                             String classAlias,
                             antlr.collections.AST parent)
                      throws antlr.SemanticException
Throws:
antlr.SemanticException

isReturnableEntity

public boolean isReturnableEntity()
                           throws antlr.SemanticException
Description copied from interface: SelectExpression
Returns true if this select expression represents an entity that can be returned.

Specified by:
isReturnableEntity in interface SelectExpression
Overrides:
isReturnableEntity in class AbstractSelectExpression
Returns:
true if this select expression represents an entity that can be returned.
Throws:
antlr.SemanticException

resolveInFunctionCall

public void resolveInFunctionCall(boolean generateJoin,
                                  boolean implicitJoin)
                           throws antlr.SemanticException
Description copied from interface: ResolvableNode
Does the work of resolving inside of the scope of a function call

Specified by:
resolveInFunctionCall in interface ResolvableNode
Throws:
antlr.SemanticException

resolve

public void resolve(boolean generateJoin,
                    boolean implicitJoin)
             throws antlr.SemanticException
Description copied from interface: ResolvableNode
Does the work of resolving an identifier or a dot, but without a parent node or alias

Specified by:
resolve in interface ResolvableNode
Throws:
antlr.SemanticException

resolve

public void resolve(boolean generateJoin,
                    boolean implicitJoin,
                    String classAlias)
             throws antlr.SemanticException
Description copied from interface: ResolvableNode
Does the work of resolving an identifier or a dot, but without a parent node

Specified by:
resolve in interface ResolvableNode
Throws:
antlr.SemanticException

prepareForDot

public void prepareForDot(String propertyName)
                   throws antlr.SemanticException
Throws:
antlr.SemanticException

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.