FileDocCategorySizeDatePackage
AbstractRestrictableStatement.javaAPI DocHibernate 3.2.51977Tue Jul 12 15:27:30 BST 2005org.hibernate.hql.ast.tree

AbstractRestrictableStatement

public abstract class AbstractRestrictableStatement extends AbstractStatement implements RestrictableStatement
Convenience implementation of RestrictableStatement to centralize common functionality.
author
Steve Ebersole

Fields Summary
private FromClause
fromClause
private antlr.collections.AST
whereClause
Constructors Summary
Methods Summary
public final FromClausegetFromClause()

see
org.hibernate.hql.ast.tree.RestrictableStatement#getFromClause

		if ( fromClause == null ) {
			fromClause = ( FromClause ) ASTUtil.findTypeInChildren( this, HqlSqlTokenTypes.FROM );
		}
		return fromClause;
	
protected abstract org.apache.commons.logging.LoggetLog()

public final antlr.collections.ASTgetWhereClause()

see
org.hibernate.hql.ast.tree.RestrictableStatement#getWhereClause

		if ( whereClause == null ) {
			whereClause = locateWhereClause();
			// If there is no WHERE node, make one.
			if ( whereClause == null ) {
				getLog().debug( "getWhereClause() : Creating a new WHERE clause..." );
				whereClause = ASTUtil.create( getWalker().getASTFactory(), HqlSqlTokenTypes.WHERE, "WHERE" );
				// inject the WHERE after the parent
				AST parent = ASTUtil.findTypeInChildren( this, getWhereClauseParentTokenType() );
				whereClause.setNextSibling( parent.getNextSibling() );
				parent.setNextSibling( whereClause );
			}
		}
		return whereClause;
	
protected abstract intgetWhereClauseParentTokenType()

public final booleanhasWhereClause()

see
RestrictableStatement#hasWhereClause

		AST whereClause = locateWhereClause();
		return whereClause != null && whereClause.getNumberOfChildren() > 0;
	
protected antlr.collections.ASTlocateWhereClause()

		return ASTUtil.findTypeInChildren( this, HqlSqlTokenTypes.WHERE );