Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class ConcatenationOperatorNode

extends BinaryOperatorNode
Class Inheritance
Imports
java.sql.Types, java.util.List, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.ClassName, .Limits, .SQLState, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.compile.TypeCompiler, org.apache.derby.iapi.types.DataTypeDescriptor, .StringDataValue, .TypeId

This node represents a concatenation comparison operator varying.

Field Summary

Inherited from org.apache.derby.impl.sql.compile.BinaryOperatorNode:
ANDBinaryArgTypesBinaryMethodNamesBinaryOperatorsBinaryResultTypesCONCATENATEDIVIDEEQGEGTK_BASEK_XMLEXISTSK_XMLQUERYkindLEleftInterfaceTypeleftOperandLIKELTmethodNameMINUSNEoperatorORPLUSreceiverresultInterfaceTyperightInterfaceTyperightOperandTIMES

Constructor Summary

AccessConstructor and Description
pack-priv
ConcatenationOperatorNode(ValueNode
The left operand of the concatenation
leftOperand
,
ValueNode
The right operand of the concatenation
rightOperand
,
ContextManager
The context manager
cm
)

Constructor for a ConcatenationOperatorNode

Method Summary

Modifier and TypeMethod and Description
pack-priv ValueNode
bindExpression(FromList
The FROM list for the query this expression is in, for binding columns.
fromList
,
SubqueryList
The subquery list being built as we find SubqueryNodes
subqueryList
,
List<AggregateNode>
The aggregate list being built as we find AggregateNodes
aggregates
)

Overrides org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression.

overrides BindOperatorNode.bindExpression because concatenation has special requirements for parameter binding.

private static int
pack-priv ValueNode

Returns:

a constant node representing the result of this concatenation operation, or this if the result is not known up front
evaluateConstantExpressions
()

Overrides org.apache.derby.impl.sql.compile.ValueNode.evaluateConstantExpressions.

Check if this node always evaluates to the same value.

private DataTypeDescriptor

Returns:

A DataTypeDescriptor telling the result type of the concatenate operation
resolveConcatOperation
(DataTypeDescriptor
The DataTypeDescriptor of the left operand
leftType
,
DataTypeDescriptor
The DataTypeDescriptor of the right operand
rightType
)

Resolve a concatenation operator

Inherited from org.apache.derby.impl.sql.compile.BinaryOperatorNode:
acceptChildrenbindXMLQuerycategorizeconstantExpressiongenerateExpressiongenSQLJavaSQLTreegetLeftOperandgetOrderableVariantTypegetReceiverInterfaceNamegetRightOperandisConstantExpressionisEquivalentisSameNodeKindpreprocessprintSubNodesremapColumnReferencesToExpressionssetLeftOperandsetLeftRightInterfaceTypesetMethodNamesetOperatorsetRightOperandtoString

Constructor Detail

ConcatenationOperatorNodeback to summary
pack-priv ConcatenationOperatorNode(ValueNode leftOperand, ValueNode rightOperand, ContextManager cm)

Constructor for a ConcatenationOperatorNode

Parameters
leftOperand:ValueNode

The left operand of the concatenation

rightOperand:ValueNode

The right operand of the concatenation

cm:ContextManager

The context manager

Method Detail

bindExpressionback to summary
pack-priv ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) throws StandardException

Overrides org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression.

overrides BindOperatorNode.bindExpression because concatenation has special requirements for parameter binding.

Parameters
fromList:FromList

Doc from org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression.

The FROM list for the query this expression is in, for binding columns.

subqueryList:SubqueryList

Doc from org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression.

The subquery list being built as we find SubqueryNodes

aggregates:List<AggregateNode>

Doc from org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression.

The aggregate list being built as we find AggregateNodes

Returns:ValueNode

Doc from org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression.

The new top of the expression tree.

Annotations
@Override
Exceptions
StandardException:
thrown on failure
clobBlobHandlingback to summary
private static int clobBlobHandling(DataTypeDescriptor clobBlobType, DataTypeDescriptor otherType) throws StandardException
evaluateConstantExpressionsback to summary
pack-priv ValueNode evaluateConstantExpressions() throws StandardException

Overrides org.apache.derby.impl.sql.compile.ValueNode.evaluateConstantExpressions.

Check if this node always evaluates to the same value. If so, return a constant node representing the known result.

Returns:ValueNode

a constant node representing the result of this concatenation operation, or this if the result is not known up front

Annotations
@Override
Exceptions
StandardException:

Doc from org.apache.derby.impl.sql.compile.ValueNode.evaluateConstantExpressions.

if an error occurs during evaluation

resolveConcatOperationback to summary
private DataTypeDescriptor resolveConcatOperation(DataTypeDescriptor leftType, DataTypeDescriptor rightType) throws StandardException

Resolve a concatenation operator

Parameters
leftType:DataTypeDescriptor

The DataTypeDescriptor of the left operand

rightType:DataTypeDescriptor

The DataTypeDescriptor of the right operand

Returns:DataTypeDescriptor

A DataTypeDescriptor telling the result type of the concatenate operation

Exceptions
StandardException:
BinaryOperatorNotSupported Thrown when a BinaryOperator is not supported on the operand types.