org.hibernate.hql.ast.tree

Class BinaryArithmeticOperatorNode

Implemented Interfaces:
BinaryOperatorNode, DisplayableNode, InitializeableNode, OperatorNode, SelectExpression

public class BinaryArithmeticOperatorNode
extends AbstractSelectExpression
implements BinaryOperatorNode, DisplayableNode

Nodes which represent binary arithmetic operators.
Author:
Gavin King

Method Summary

Type
getDataType()
Figure out the type of the binary expression by looking at the types of the operands.
String
getDisplayText()
Returns additional display text for the AST node.
Node
getLeftHandOperand()
Retrieves the left-hand operand of the operator.
Node
getRightHandOperand()
Retrieves the right-hand operand of the operator.
void
initialize()
void
setScalarColumnText(int i)
Appends AST nodes that represent the columns after the current AST node.

Methods inherited from class org.hibernate.hql.ast.tree.AbstractSelectExpression

getAlias, getFromElement, isConstructor, isReturnableEntity, isScalar, setAlias

Methods inherited from class org.hibernate.hql.ast.tree.HqlSqlWalkerNode

getASTFactory, getAliasGenerator, getSessionFactoryHelper, getWalker, initialize

Methods inherited from class org.hibernate.hql.ast.tree.SqlNode

getDataType, getOriginalText, setDataType, setText

Methods inherited from class org.hibernate.hql.ast.tree.Node

getColumn, getFilename, getLine, getRenderText, getTextLength, initialize, initialize

Method Details

getDataType

public Type 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.
Specified by:
getDataType in interface OperatorNode
getDataType in interface SelectExpression
Overrides:
getDataType in interface SqlNode

getDisplayText

public String getDisplayText()
Returns additional display text for the AST node.
Specified by:
getDisplayText in interface DisplayableNode
Returns:
String - The additional display text.

getLeftHandOperand

public Node getLeftHandOperand()
Retrieves the left-hand operand of the operator.
Specified by:
getLeftHandOperand in interface BinaryOperatorNode
Returns:
The left-hand operand

getRightHandOperand

public Node getRightHandOperand()
Retrieves the right-hand operand of the operator.
Specified by:
getRightHandOperand in interface BinaryOperatorNode
Returns:
The right-hand operand

initialize

public void initialize()
            throws SemanticException
Specified by:
initialize in interface OperatorNode

setScalarColumnText

public void setScalarColumnText(int i)
            throws SemanticException
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.