public class

QueryNode

extends AbstractRestrictableStatement
implements SelectExpression
java.lang.Object
   ↳ 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

Class Overview

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

Summary

Public Constructors
QueryNode()
Public Methods
String getAlias()
Type getDataType()
FromElement getFromElement()
Returns the FROM element that this expression refers to.
final OrderByClause getOrderByClause()
int getScalarColumnIndex()
Gets index of the select expression in the projection list.
final SelectClause getSelectClause()
Locate the select clause that is part of this select statement.
int getStatementType()
final boolean hasOrderByClause()
boolean isConstructor()
Returns true if the element is a constructor (e.g.
boolean isReturnableEntity()
Returns true if this select expression represents an entity that can be returned.
boolean isScalar()
boolean needsExecutor()
void setAlias(String alias)
void setScalarColumn(int i)
Sets the index and text for select expression in the projection list.
void setScalarColumnText(int i)
Appends AST nodes that represent the columns after the current AST node.
Protected Methods
Logger getLog()
int getWhereClauseParentTokenType()
[Expand]
Inherited Methods
From class org.hibernate.hql.ast.tree.AbstractRestrictableStatement
From class org.hibernate.hql.ast.tree.AbstractStatement
From class org.hibernate.hql.ast.tree.HqlSqlWalkerNode
From class org.hibernate.hql.ast.tree.SqlNode
From class org.hibernate.hql.ast.tree.Node
From class java.lang.Object
From interface org.hibernate.hql.ast.tree.DisplayableNode
From interface org.hibernate.hql.ast.tree.InitializeableNode
From interface org.hibernate.hql.ast.tree.RestrictableStatement
From interface org.hibernate.hql.ast.tree.SelectExpression
From interface org.hibernate.hql.ast.tree.Statement

Public Constructors

public QueryNode ()

Public Methods

public String getAlias ()

public Type getDataType ()

public FromElement getFromElement ()

Returns the FROM element that this expression refers to.

Returns
  • The FROM element.

public final OrderByClause getOrderByClause ()

public int getScalarColumnIndex ()

Gets index of the select expression in the projection list.

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.

public int getStatementType ()

public final boolean hasOrderByClause ()

public boolean isConstructor ()

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

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

public boolean isReturnableEntity ()

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

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

public boolean isScalar ()

Throws
SemanticException

public boolean needsExecutor ()

See Also

public void setAlias (String alias)

public void setScalarColumn (int i)

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

Parameters
i The index of the select expression in the projection list.
Throws
SemanticException

public void setScalarColumnText (int i)

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

Parameters
i The index of the select expression in the projection list.
Throws
SemanticException

Protected Methods

protected Logger getLog ()

protected int getWhereClauseParentTokenType ()