FileDocCategorySizeDatePackage
FromReferenceNode.javaAPI DocHibernate 3.2.53136Fri Jul 15 11:20:04 BST 2005org.hibernate.hql.ast.tree

FromReferenceNode

public abstract class FromReferenceNode extends AbstractSelectExpression implements ResolvableNode, InitializeableNode, PathNode, DisplayableNode
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

Fields Summary
private static final Log
log
private FromElement
fromElement
private boolean
resolved
public static final int
ROOT_LEVEL
Constructors Summary
Methods Summary
public java.lang.StringgetDisplayText()

		StringBuffer buf = new StringBuffer();
		buf.append( "{" ).append( ( fromElement == null ) ? "no fromElement" : fromElement.getDisplayText() );
		buf.append( "}" );
		return buf.toString();
	
public FromElementgetFromElement()


	   
		return fromElement;
	
public FromElementgetImpliedJoin()
Sub-classes can override this method if they produce implied joins (e.g. DotNode).

return
an implied join created by this from reference.

		return null;
	
public java.lang.StringgetPath()

		return getOriginalText();
	
public booleanisResolved()

		return resolved;
	
public booleanisReturnableEntity()

		return !isScalar() && fromElement.isEntity();
	
public voidprepareForDot(java.lang.String propertyName)

	
public voidrecursiveResolve(int level, boolean impliedAtRoot, java.lang.String classAlias)

		recursiveResolve( level, impliedAtRoot, classAlias, this );
	
public voidrecursiveResolve(int level, boolean impliedAtRoot, java.lang.String classAlias, antlr.collections.AST parent)

		AST lhs = getFirstChild();
		int nextLevel = level + 1;
		if ( lhs != null ) {
			FromReferenceNode n = ( FromReferenceNode ) lhs;
			n.recursiveResolve( nextLevel, impliedAtRoot, null, this );
		}
		resolveFirstChild();
		boolean impliedJoin = true;
		if ( level == ROOT_LEVEL && !impliedAtRoot ) {
			impliedJoin = false;
		}
		resolve( true, impliedJoin, classAlias, parent );
	
public voidresolve(boolean generateJoin, boolean implicitJoin)

		resolve( generateJoin, implicitJoin, null );
	
public voidresolve(boolean generateJoin, boolean implicitJoin, java.lang.String classAlias)

		resolve( generateJoin, implicitJoin, classAlias, null );
	
public voidresolveFirstChild()
Resolves the left hand side of the DOT.

throws
SemanticException

	
public voidresolveInFunctionCall(boolean generateJoin, boolean implicitJoin)

		resolve( generateJoin, implicitJoin );
	
public voidsetFromElement(FromElement fromElement)

		this.fromElement = fromElement;
	
public voidsetResolved()

		this.resolved = true;
		if ( log.isDebugEnabled() ) {
			log.debug( "Resolved :  " + this.getPath() + " -> " + this.getText() );
		}