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

public Class BinaryLogicOperatorNode

extends AbstractSelectExpression
implements BinaryOperatorNode
Class Inheritance
All Implemented Interfaces
org.hibernate.hql.internal.ast.tree.BinaryOperatorNode, org.hibernate.hql.internal.ast.tree.OperatorNode
Known Direct Subclasses
org.hibernate.hql.internal.ast.tree.InLogicOperatorNode
Imports
java.util.Arrays, org.hibernate.HibernateException, .TypeMismatchException, org.hibernate.dialect.Dialect, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.hql.internal.antlr.HqlSqlTokenTypes, org.hibernate.hql.internal.ast.QuerySyntaxException, org.hibernate.hql.internal.ast.util.ColumnHelper, org.hibernate.internal.util.StringHelper, org.hibernate.param.ParameterSpecification, org.hibernate.type.OneToOneType, .StandardBasicTypes, .Type, antlr.SemanticException, antlr.collections.AST

Contract for nodes representing binary operators.
Author
Steve Ebersole

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
copyReferencedTables(Node from, SqlFragment to)

Deprecated as a consequence of SqlFragment being deprecated.
protected Type
protected static String[]
extractMutationTexts(Node operand, int count)

private int
getColumnSpan(Type type, SessionFactoryImplementor sfi)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public Type
public Node

Returns:

The left-hand operand
getLeftHandOperand
()

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

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

Returns:

The right-hand operand
getRightHandOperand
()

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

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

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

Performs the operator node initialization by seeking out any parameter nodes and setting their expected type, if possible.
private boolean
private void
mutateRowValueConstructorSyntax(int
The number of elements in the row value constructor list.
valueElements
)

Mutate the subtree relating to a row-value-constructor to instead use a series of ANDed predicates.

protected final void
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.
protected void
translate(int valueElements, int comparisonType, String comparisonText, String[] lhsElementTexts, String[] rhsElementTexts, ParameterSpecification lhsEmbeddedCompositeParameterSpecification, ParameterSpecification rhsEmbeddedCompositeParameterSpecification, AST container)

private boolean
Inherited from org.hibernate.hql.internal.ast.tree.AbstractSelectExpression:
getAliasgetFromElementgetScalarColumnIndexisConstructorisReturnableEntityisScalarsetAliassetScalarColumn

Constructor Detail

BinaryLogicOperatorNodeback to summary
public BinaryLogicOperatorNode()

Method Detail

copyReferencedTablesback to summary
private static void copyReferencedTables(Node from, SqlFragment to)

Deprecated

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

extractDataTypeback to summary
protected Type extractDataType(Node operand)
extractMutationTextsback to summary
protected static String[] extractMutationTexts(Node operand, int count)
getColumnSpanback to summary
private int getColumnSpan(Type type, SessionFactoryImplementor sfi)

Deprecated

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

getDataTypeback to summary
public Type getDataType()

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

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

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

Retrieves the data type for the overall operator expression.

Returns:Type

The expression's data type.

Annotations
@Override
getLeftHandOperandback to summary
public Node getLeftHandOperand()

Implements org.hibernate.hql.internal.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.internal.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.internal.ast.tree.OperatorNode.initialize.

Performs the operator node initialization by seeking out any parameter nodes and setting their expected type, if possible.

Annotations
@Override
isInsideSetClauseback to summary
private boolean isInsideSetClause()
mutateRowValueConstructorSyntaxback to summary
private void mutateRowValueConstructorSyntax(int valueElements)

Mutate the subtree relating to a row-value-constructor to instead use a series of ANDed predicates. This allows multi-column type comparisons and explicit row-value-constructor syntax even on databases which do not support row-value-constructor.

For example, here we'd mutate "... where (col1, col2) = ('val1', 'val2) ..." to "... where col1 = 'val1' and col2 = 'val2' ..."

Parameters
valueElements:int

The number of elements in the row value constructor list.

mutateRowValueConstructorSyntaxesIfNecessaryback to summary
protected final void mutateRowValueConstructorSyntaxesIfNecessary(Type lhsType, Type rhsType)
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.

Exceptions
SemanticException:
if a semantic error occurs
translateback to summary
protected void translate(int valueElements, int comparisonType, String comparisonText, String[] lhsElementTexts, String[] rhsElementTexts, ParameterSpecification lhsEmbeddedCompositeParameterSpecification, ParameterSpecification rhsEmbeddedCompositeParameterSpecification, AST container)
useRowValueConstructorSyntaxback to summary
private boolean useRowValueConstructorSyntax(Dialect dialect)