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

public Class BinaryArithmeticOperatorNode

extends AbstractSelectExpression
implements BinaryOperatorNode, DisplayableNode
Class Inheritance
All Implemented Interfaces
org.hibernate.hql.ast.tree.DisplayableNode, org.hibernate.hql.ast.tree.BinaryOperatorNode, org.hibernate.hql.ast.tree.OperatorNode
Imports
org.hibernate.Hibernate, org.hibernate.hql.ast.util.ColumnHelper, org.hibernate.hql.antlr.HqlSqlTokenTypes, org.hibernate.type.Type, antlr.SemanticException

Nodes which represent binary arithmetic operators.
Author
Gavin King

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Type
getDataType()

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

Implements org.hibernate.hql.ast.tree.OperatorNode.getDataType, org.hibernate.hql.ast.tree.SelectExpression.getDataType.

Figure out the type of the binary expression by looking at the types of the operands.
public String
getDisplayText()

Implements org.hibernate.hql.ast.tree.DisplayableNode.getDisplayText.

Returns additional display text for the AST node.
public Node

Returns:

The left-hand operand
getLeftHandOperand
()

Implements org.hibernate.hql.ast.tree.BinaryOperatorNode.getLeftHandOperand.

Retrieves the left-hand operand of the operator.
public Node

Returns:

The right-hand operand
getRightHandOperand
()

Implements org.hibernate.hql.ast.tree.BinaryOperatorNode.getRightHandOperand.

Retrieves the right-hand operand of the operator.
public void
initialize()

Implements org.hibernate.hql.ast.tree.OperatorNode.initialize.

Called by the tree walker during hql-sql semantic analysis after the operator sub-tree is completely built.
private boolean
private Type
private Type
public void
setScalarColumnText(int
The index of the select expression in the projection list.
i
)

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

Appends AST nodes that represent the columns after the current AST node.
Inherited from org.hibernate.hql.ast.tree.AbstractSelectExpression:
getAliasgetFromElementgetScalarColumnIndexisConstructorisReturnableEntityisScalarsetAliassetScalarColumn

Constructor Detail

BinaryArithmeticOperatorNodeback to summary
public BinaryArithmeticOperatorNode()

Method Detail

getDataTypeback to summary
public Type getDataType()

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

Implements org.hibernate.hql.ast.tree.OperatorNode.getDataType, org.hibernate.hql.ast.tree.SelectExpression.getDataType.

Figure out the type of the binary expression by looking at the types of the operands. Sometimes we don't know both types, if, for example, one is a parameter.

Returns:Type

Doc from org.hibernate.hql.ast.tree.OperatorNode.getDataType.

The expression's data type.

getDisplayTextback to summary
public String getDisplayText()

Implements org.hibernate.hql.ast.tree.DisplayableNode.getDisplayText.

Doc from org.hibernate.hql.ast.tree.DisplayableNode.getDisplayText.

Returns additional display text for the AST node.

Returns:String

String - The additional display text.

getLeftHandOperandback to summary
public Node getLeftHandOperand()

Implements org.hibernate.hql.ast.tree.BinaryOperatorNode.getLeftHandOperand.

Retrieves the left-hand operand of the operator.

Returns:Node

The left-hand operand

getRightHandOperandback to summary
public Node getRightHandOperand()

Implements org.hibernate.hql.ast.tree.BinaryOperatorNode.getRightHandOperand.

Retrieves the right-hand operand of the operator.

Returns:Node

The right-hand operand

initializeback to summary
public void initialize() throws SemanticException

Implements org.hibernate.hql.ast.tree.OperatorNode.initialize.

Doc from org.hibernate.hql.ast.tree.OperatorNode.initialize.

Called by the tree walker during hql-sql semantic analysis after the operator sub-tree is completely built.

isDateTimeTypeback to summary
private boolean isDateTimeType(Type type)
resolveDataTypeback to summary
private Type resolveDataType()
resolveDateTimeArithmeticResultTypeback to summary
private Type resolveDateTimeArithmeticResultType(Type lhType, Type rhType)
setScalarColumnTextback to summary
public void setScalarColumnText(int i) throws SemanticException

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

Doc from org.hibernate.hql.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.