Package org.hibernate.hql.ast.tree
Class QueryNode
- All Implemented Interfaces:
antlr.collections.AST,Serializable,DisplayableNode,InitializeableNode,RestrictableStatement,SelectExpression,Statement
Defines a top-level AST node representing an HQL select statement.
- See Also:
-
Field Summary
Fields inherited from class antlr.BaseAST
down, right -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAlias()Returns the data type of the select expression.Returns the FROM element that this expression refers to.protected LoggergetLog()final OrderByClauseintGets index of the select expression in the projection list.final SelectClauseLocate the select clause that is part of this select statement.intReturn the main token type representing the type of this statement.protected intfinal booleanbooleanReturns true if the element is a constructor (e.g.booleanReturns true if this select expression represents an entity that can be returned.booleanisScalar()booleanDoes this statement require the StatementExecutor?voidvoidsetScalarColumn(int i) Sets the index and text for select expression in the projection list.voidsetScalarColumnText(int i) Appends AST nodes that represent the columns after the current AST node.Methods inherited from class org.hibernate.hql.ast.tree.AbstractRestrictableStatement
getFromClause, getWhereClause, hasWhereClause, locateWhereClauseMethods inherited from class org.hibernate.hql.ast.tree.AbstractStatement
getDisplayTextMethods inherited from class org.hibernate.hql.ast.tree.HqlSqlWalkerNode
getAliasGenerator, getASTFactory, getSessionFactoryHelper, getWalker, initializeMethods inherited from class org.hibernate.hql.ast.tree.SqlNode
getOriginalText, setDataType, setTextMethods inherited from class org.hibernate.hql.ast.tree.Node
getColumn, getFilename, getLine, getRenderText, getTextLength, initialize, initializeMethods inherited from class antlr.CommonAST
getText, getType, initialize, setTypeMethods 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, xmlSerializeRootOpenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.hql.ast.tree.SelectExpression
setText
-
Constructor Details
-
QueryNode
public QueryNode()
-
-
Method Details
-
getStatementType
public int getStatementType()Description copied from interface:StatementReturn the main token type representing the type of this statement.- Specified by:
getStatementTypein interfaceStatement- Returns:
- The corresponding token type.
- See Also:
-
needsExecutor
public boolean needsExecutor()Description copied from interface:StatementDoes this statement require the StatementExecutor? Essentially, at the JDBC level, does this require an executeUpdate()?- Specified by:
needsExecutorin interfaceStatement- Returns:
- True if this statement should be handed off to the StatementExecutor to be executed; false otherwise.
- See Also:
-
getWhereClauseParentTokenType
protected int getWhereClauseParentTokenType()- Specified by:
getWhereClauseParentTokenTypein classAbstractRestrictableStatement
-
getLog
- Specified by:
getLogin classAbstractRestrictableStatement
-
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
-
getAlias
- Specified by:
getAliasin interfaceSelectExpression
-
getFromElement
Description copied from interface:SelectExpressionReturns the FROM element that this expression refers to.- Specified by:
getFromElementin interfaceSelectExpression- Returns:
- The FROM element.
-
isConstructor
public boolean isConstructor()Description copied from interface:SelectExpressionReturns true if the element is a constructor (e.g. new Foo).- Specified by:
isConstructorin interfaceSelectExpression- Returns:
- true if the element is a constructor (e.g. new Foo).
-
isReturnableEntity
Description copied from interface:SelectExpressionReturns true if this select expression represents an entity that can be returned.- Specified by:
isReturnableEntityin interfaceSelectExpression- Returns:
- true if this select expression represents an entity that can be returned.
- Throws:
antlr.SemanticException
-
isScalar
- Specified by:
isScalarin interfaceSelectExpression- Throws:
antlr.SemanticException
-
setAlias
- Specified by:
setAliasin interfaceSelectExpression
-
setScalarColumn
Description copied from interface:SelectExpressionSets the index and text for select expression in the projection list.- Specified by:
setScalarColumnin interfaceSelectExpression- Parameters:
i- The index of the select expression in the projection list.- Throws:
antlr.SemanticException
-
getScalarColumnIndex
public int getScalarColumnIndex()Description copied from interface:SelectExpressionGets index of the select expression in the projection list.- Specified by:
getScalarColumnIndexin interfaceSelectExpression
-
setScalarColumnText
Description copied from interface:SelectExpressionAppends AST nodes that represent the columns after the current AST node. (e.g. 'as col0_O_')- Specified by:
setScalarColumnTextin interfaceSelectExpression- Parameters:
i- The index of the select expression in the projection list.- Throws:
antlr.SemanticException
-
getDataType
Description copied from interface:SelectExpressionReturns the data type of the select expression.- Specified by:
getDataTypein interfaceSelectExpression- Overrides:
getDataTypein classSqlNode- Returns:
- The data type of the select expression.
-