Top Description Fields Constructors Methods
org.hibernate.hql.internal.ast.tree

public Class QueryNode

extends AbstractRestrictableStatement
implements SelectExpression
Class Inheritance
All Implemented Interfaces
org.hibernate.hql.internal.ast.tree.SelectExpression
Imports
org.hibernate.hql.internal.antlr.HqlSqlTokenTypes, .SqlTokenTypes, org.hibernate.hql.internal.ast.util.ASTUtil, .ColumnHelper, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.type.Type, antlr.SemanticException, antlr.collections.AST

Defines a top-level AST node representing an HQL select statement.
Author
Joshua Davis

Field Summary

Modifier and TypeField and Description
private String
private static final CoreMessageLogger
private OrderByClause
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public Type
public FromElement
getFromElement()

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.getFromElement.

Deprecated as a consequence of FromElement being deprecated.
Returns the FROM element that this expression refers to.
protected CoreMessageLogger
public final OrderByClause
public int
getScalarColumnIndex()

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.getScalarColumnIndex.

Gets index of the select expression in the projection list.
public final SelectClause

Returns:

Our select clause, or null.
getSelectClause
()

Locate the select clause that is part of this select statement.

public int
getStatementType()

Implements org.hibernate.hql.internal.ast.tree.Statement.getStatementType.

Return the main token type representing the type of this statement.
protected int
public final boolean
public boolean
isConstructor()

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.isConstructor.

Returns true if the element is a constructor (e.g. new Foo).
public boolean
isReturnableEntity()

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.isReturnableEntity.

Returns true if this select expression represents an entity that can be returned.
public boolean
private OrderByClause
public boolean
needsExecutor()

Implements org.hibernate.hql.internal.ast.tree.Statement.needsExecutor.

Does this statement require the StatementExecutor?
public void
public void
setScalarColumn(int
The index of the select expression in the projection list.
i
)

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumn.

Sets the index and text for select expression in the projection list.
public void
setScalarColumnText(int
The index of the select expression in the projection list.
i
)

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumnText.

Appends AST nodes that represent the columns after the current AST node.
Inherited from org.hibernate.hql.internal.ast.tree.AbstractRestrictableStatement:
getFromClausegetWhereClausehasWhereClauselocateWhereClause

Field Detail

aliasback to summary
private String alias
LOGback to summary
private static final CoreMessageLogger LOG
orderByClauseback to summary
private OrderByClause orderByClause
scalarColumnIndexback to summary
private int scalarColumnIndex

Constructor Detail

QueryNodeback to summary
public QueryNode()

Method Detail

getAliasback to summary
public String getAlias()

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.getAlias.

Annotations
@Override
getDataTypeback to summary
public Type getDataType()

Overrides org.hibernate.hql.internal.ast.tree.SqlNode.getDataType.

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.getDataType.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.getDataType.

Returns the data type of the select expression.

Returns:Type

The data type of the select expression.

Annotations
@Override
getFromElementback to summary
public FromElement getFromElement()

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.getFromElement.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.getFromElement.

Deprecated

as a consequence of FromElement being deprecated. See corresponding docs for further information.

Returns the FROM element that this expression refers to.

Returns:FromElement

The FROM element.

Annotations
@Override
getLogback to summary
protected CoreMessageLogger getLog()

Implements abstract org.hibernate.hql.internal.ast.tree.AbstractRestrictableStatement.getLog.

Annotations
@Override
getOrderByClauseback to summary
public final OrderByClause getOrderByClause()
getScalarColumnIndexback to summary
public int getScalarColumnIndex()

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.getScalarColumnIndex.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.getScalarColumnIndex.

Gets index of the select expression in the projection list.

Returns:int

The index of the select expression in the projection list.

Annotations
@Override
getSelectClauseback to summary
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:SelectClause

Our select clause, or null.

getStatementTypeback to summary
public int getStatementType()

Implements org.hibernate.hql.internal.ast.tree.Statement.getStatementType.

Doc from org.hibernate.hql.internal.ast.tree.Statement.getStatementType.

Return the main token type representing the type of this statement.

Returns:int

The corresponding token type.

Annotations
@Override
getWhereClauseParentTokenTypeback to summary
protected int getWhereClauseParentTokenType()

Implements abstract org.hibernate.hql.internal.ast.tree.AbstractRestrictableStatement.getWhereClauseParentTokenType.

Annotations
@Override
hasOrderByClauseback to summary
public final boolean hasOrderByClause()
isConstructorback to summary
public boolean isConstructor()

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.isConstructor.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.isConstructor.

Returns true if the element is a constructor (e.g. new Foo).

Returns:boolean

true if the element is a constructor (e.g. new Foo).

Annotations
@Override
isReturnableEntityback to summary
public boolean isReturnableEntity() throws SemanticException

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.isReturnableEntity.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.isReturnableEntity.

Returns true if this select expression represents an entity that can be returned.

Returns:boolean

true if this select expression represents an entity that can be returned.

Annotations
@Override
Exceptions
SemanticException:
if a semantic error occurs
isScalarback to summary
public boolean isScalar() throws SemanticException

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.isScalar.

Annotations
@Override
locateOrderByClauseback to summary
private OrderByClause locateOrderByClause()
needsExecutorback to summary
public boolean needsExecutor()

Implements org.hibernate.hql.internal.ast.tree.Statement.needsExecutor.

Doc from org.hibernate.hql.internal.ast.tree.Statement.needsExecutor.

Does this statement require the StatementExecutor?

Essentially, at the JDBC level, does this require an executeUpdate()?
Returns:boolean

True if this statement should be handed off to the StatementExecutor to be executed; false otherwise.

Annotations
@Override
setAliasback to summary
public void setAlias(String alias)

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setAlias.

Annotations
@Override
setScalarColumnback to summary
public void setScalarColumn(int i) throws SemanticException

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumn.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumn.

Sets the index and text for select expression in the projection list.

Parameters
i:int

The index of the select expression in the projection list.

Annotations
@Override
Exceptions
SemanticException:
if a semantic error occurs
setScalarColumnTextback to summary
public void setScalarColumnText(int i) throws SemanticException

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumnText.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumnText.

Appends AST nodes that represent the columns after the current AST node. (e.g. 'as col0_O_')

Parameters
i:int

The index of the select expression in the projection list.

Annotations
@Override
Exceptions
SemanticException:
if a semantic error occurs