org.hibernate.hql.ast.tree
Class QueryNode
java.lang.Object
antlr.BaseAST
antlr.CommonAST
org.hibernate.hql.ast.tree.Node
org.hibernate.hql.ast.tree.SqlNode
org.hibernate.hql.ast.tree.HqlSqlWalkerNode
org.hibernate.hql.ast.tree.AbstractStatement
org.hibernate.hql.ast.tree.AbstractRestrictableStatement
org.hibernate.hql.ast.tree.QueryNode
- All Implemented Interfaces:
- antlr.collections.AST, Serializable, DisplayableNode, InitializeableNode, RestrictableStatement, SelectExpression, Statement
public class QueryNode
- extends AbstractRestrictableStatement
- implements SelectExpression
Defines a top-level AST node representing an HQL select statement.
- Author:
- Joshua Davis
- See Also:
- Serialized Form
Fields inherited from class antlr.BaseAST |
down, right |
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 |
QueryNode
public QueryNode()
getStatementType
public int getStatementType()
- Description copied from interface:
Statement
- Return the main token type representing the type of this statement.
- Specified by:
getStatementType
in interface Statement
- Returns:
- The corresponding token type.
- See Also:
Statement.getStatementType()
needsExecutor
public boolean needsExecutor()
- Description copied from interface:
Statement
- Does this statement require the StatementExecutor?
Essentially, at the JDBC level, does this require an executeUpdate()?
- Specified by:
needsExecutor
in interface Statement
- Returns:
- True if this statement should be handed off to the
StatementExecutor to be executed; false otherwise.
- See Also:
Statement.needsExecutor()
getWhereClauseParentTokenType
protected int getWhereClauseParentTokenType()
- Specified by:
getWhereClauseParentTokenType
in class AbstractRestrictableStatement
getLog
protected org.apache.commons.logging.Log getLog()
- Specified by:
getLog
in class AbstractRestrictableStatement
getSelectClause
public final SelectClause getSelectClause()
- Locate the select clause that is part of this select statement.
Note, that this might return null as derived select clauses (i.e., no
select clause at the HQL-level) get generated much later than when we
get created; thus it depends upon lifecycle.
- Returns:
- Our select clause, or null.
hasOrderByClause
public final boolean hasOrderByClause()
getOrderByClause
public final OrderByClause getOrderByClause()
getAlias
public String getAlias()
- Specified by:
getAlias
in interface SelectExpression
getFromElement
public FromElement getFromElement()
- Description copied from interface:
SelectExpression
- Returns the FROM element that this expression refers to.
- Specified by:
getFromElement
in interface SelectExpression
- Returns:
- The FROM element.
isConstructor
public boolean isConstructor()
- Description copied from interface:
SelectExpression
- Returns true if the element is a constructor (e.g. new Foo).
- Specified by:
isConstructor
in interface SelectExpression
- Returns:
- true if the element is a constructor (e.g. new Foo).
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
- Returns:
- true if this select expression represents an entity that can be returned.
- Throws:
antlr.SemanticException
isScalar
public boolean isScalar()
throws antlr.SemanticException
- Specified by:
isScalar
in interface SelectExpression
- Throws:
antlr.SemanticException
setAlias
public void setAlias(String alias)
- Specified by:
setAlias
in interface SelectExpression
setScalarColumnText
public void setScalarColumnText(int i)
throws antlr.SemanticException
- Description copied from interface:
SelectExpression
- Appends AST nodes that represent the columns after the current AST node.
(e.g. 'as col0_O_')
- Specified by:
setScalarColumnText
in interface SelectExpression
- Parameters:
i
- The index of the select expression in the projection list.
- Throws:
antlr.SemanticException
getDataType
public Type getDataType()
- Description copied from interface:
SelectExpression
- Returns the data type of the select expression.
- Specified by:
getDataType
in interface SelectExpression
- Overrides:
getDataType
in class SqlNode
- Returns:
- The data type of the select expression.