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

pack-priv Class TestConstraintNode

extends UnaryLogicalOperatorNode
Class Inheritance
Imports
java.util.List, org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.ClassName, org.apache.derby.iapi.services.classfile.VMOpcode, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor, org.apache.derby.iapi.types.DataTypeDescriptor, .TypeId

A TestConstraintNode is used to determine when a constraint has been violated.

Field Summary

Modifier and TypeField and Description
private final UUID
private final String
private final boolean
private final String
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
TestConstraintNode(ValueNode
The operand of the constraint test
booleanValue
,
String
The SQLState of the exception to throw if the constraint has failed
sqlState
,
String
The name of the table that the constraint is on
tableName
,
ConstraintDescriptor
The descriptor of the constraint being checked
cd
,
ContextManager
context manager
cm
)

Method Summary

Modifier and TypeMethod and Description
pack-priv ValueNode

Returns:

The new top of the expression tree.
bindExpression
(FromList
The query's FROM list
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.UnaryLogicalOperatorNode.bindExpression.

Bind this logical operator.

pack-priv void
generateExpression(ExpressionClassBuilder
The ExpressionClassBuilder for the class we're generating
acb
,
MethodBuilder
The method the expression will go into
mb
)

Overrides org.apache.derby.impl.sql.compile.UnaryOperatorNode.generateExpression.

Do code generation for the TestConstraint operator.

Inherited from org.apache.derby.impl.sql.compile.UnaryLogicalOperatorNode:
setFullTypeInfo

Field Detail

cidback to summary
private final UUID cid
constraintNameback to summary
private final String constraintName
deferrableback to summary
private final boolean deferrable
sqlStateback to summary
private final String sqlState
tableNameback to summary
private final String tableName

Constructor Detail

TestConstraintNodeback to summary
pack-priv TestConstraintNode(ValueNode booleanValue, String sqlState, String tableName, ConstraintDescriptor cd, ContextManager cm) throws StandardException
Parameters
booleanValue:ValueNode

The operand of the constraint test

sqlState:String

The SQLState of the exception to throw if the constraint has failed

tableName:String

The name of the table that the constraint is on

cd:ConstraintDescriptor

The descriptor of the constraint being checked

cm:ContextManager

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.UnaryLogicalOperatorNode.bindExpression.

Bind this logical operator. All that has to be done for binding a logical operator is to bind the operand, check that the operand is SQLBoolean, and set the result type to SQLBoolean.

Parameters
fromList:FromList

The query's FROM list

subqueryList:SubqueryList

The subquery list being built as we find SubqueryNodes

aggregates:List<AggregateNode>

The aggregate list being built as we find AggregateNodes

Returns:ValueNode

The new top of the expression tree.

Exceptions
StandardException:
Thrown on error
generateExpressionback to summary
pack-priv void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException

Overrides org.apache.derby.impl.sql.compile.UnaryOperatorNode.generateExpression.

Do code generation for the TestConstraint operator.

Parameters
acb:ExpressionClassBuilder

The ExpressionClassBuilder for the class we're generating

mb:MethodBuilder

The method the expression will go into

Annotations
@Override
Exceptions
StandardException:
Thrown on error