Visitable
FKConstraintDefinitionNode
public class ConstraintDefinitionNode extends TableElementNode
Modifier and Type | Field | Description |
---|---|---|
(package private) ProviderList |
apl |
|
(package private) java.lang.String |
backingIndexName |
|
(package private) UUID |
backingIndexUUID |
|
private int |
behavior |
|
private boolean[] |
characteristics |
boolean[3]: {deferrable?
|
(package private) ValueNode |
checkCondition |
|
(package private) ResultColumnList |
columnList |
|
private TableName |
constraintName |
|
(package private) java.lang.String |
constraintText |
|
protected int |
constraintType |
|
static boolean |
DEFERRABLE_DEFAULT |
|
static boolean |
ENFORCED_DEFAULT |
|
static boolean |
INITIALLY_DEFERRED_DEFAULT |
|
protected java.util.Properties |
properties |
|
(package private) UUIDFactory |
uuidFactory |
|
private int |
verifyType |
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
AT_ADD_CHECK_CONSTRAINT, AT_ADD_FOREIGN_KEY_CONSTRAINT, AT_ADD_PRIMARY_KEY_CONSTRAINT, AT_ADD_UNIQUE_CONSTRAINT, AT_DROP_COLUMN, AT_DROP_CONSTRAINT, AT_MODIFY_COLUMN, AT_MODIFY_CONSTRAINT, AT_UNKNOWN, elementType, name
Constructor | Description |
---|---|
ConstraintDefinitionNode(TableName constraintName,
int constraintType,
ResultColumnList rcl,
java.util.Properties properties,
ValueNode checkCondition,
java.lang.String constraintText,
int behavior,
int verifyType,
ContextManager cm) |
Modifier and Type | Method | Description |
---|---|---|
(package private) void |
acceptChildren(Visitor v) |
Accept a visitor on all child nodes.
|
(package private) void |
bind(DDLStatementNode ddlNode,
DataDictionary dd) |
Bind this constraint definition.
|
(package private) ProviderList |
getAuxiliaryProviderList() |
Return the auxiliary provider list.
|
(package private) java.lang.String |
getBackingIndexName(DataDictionary dd) |
Gets a unique name for the backing index for this constraint of the form SQLyymmddhhmmssxxn
yy - year, mm - month, dd - day of month, hh - hour, mm - minute, ss - second,
xx - the first 2 digits of millisec because we don't have enough space to keep the exact millisec value,
n - number between 0-9
|
(package private) UUID |
getBackingIndexUUID() |
Allocates a UUID if one doesn't already exist for the index backing this constraint.
|
(package private) boolean[] |
getCharacteristics() |
|
(package private) ValueNode |
getCheckCondition() |
Get the check condition from this table constraint.
|
(package private) ResultColumnList |
getColumnList() |
Get the column list from this node.
|
(package private) java.lang.String |
getConstraintMoniker() |
Get the name of the constraint.
|
(package private) java.lang.String |
getConstraintText() |
Get the text of the constraint.
|
(package private) int |
getConstraintType() |
Get the constraint type
|
(package private) int |
getDropBehavior() |
Return the behavior of this constraint.
|
(package private) java.lang.String |
getDropSchemaName() |
To support dropping existing constraints that may have mismatched schema names
we need to support ALTER TABLE S1.T DROP CONSTRAINT S2.C.
|
private static ModuleFactory |
getMonitor() |
Privileged Monitor lookup.
|
(package private) java.util.Properties |
getProperties() |
Get the optional properties for the backing index to this constraint.
|
(package private) int |
getReferenceCount() |
Get the count of enabled fks
that reference this constraint
|
private UUIDFactory |
getUUIDFactory() |
Get the UUID factory
|
(package private) int |
getVerifyType() |
|
(package private) boolean |
hasCheckConstraint() |
Does this element have a check constraint.
|
(package private) boolean |
hasConstraint() |
Does this element have a constraint on it.
|
(package private) boolean |
hasForeignKeyConstraint() |
Is this a foreign key constraint.
|
(package private) boolean |
hasPrimaryKeyConstraint() |
Is this a primary key constraint.
|
(package private) boolean |
hasUniqueKeyConstraint() |
Is this a unique key constraint.
|
(package private) boolean |
isEnabled() |
Is this constraint enabled.
|
(package private) boolean |
isReferenced() |
Is this constraint referenced.
|
(package private) void |
qualifyNames() |
Qualify all SQL object names in a CHECK constraint with schema name.
|
(package private) boolean |
requiresBackingIndex() |
Does this constraint require a backing index for its implementation?
|
(package private) boolean |
requiresUniqueIndex() |
Is this a primary key or unique constraint?
|
(package private) void |
setAuxiliaryProviderList(ProviderList apl) |
Set the auxiliary provider list.
|
(package private) void |
setCharacteristics(boolean[] cc) |
|
(package private) void |
setCheckCondition(ValueNode checkCondition) |
Set the check condition for this table constraint.
|
(package private) void |
setColumnList(ResultColumnList columnList) |
Set the column list for this node.
|
(package private) void |
setProperties(java.util.Properties properties) |
Set the optional properties for the backing index to this constraint.
|
java.lang.String |
toString() |
Convert this object to a String.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, printSubNodes, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
getElementType, getName
private TableName constraintName
protected int constraintType
protected java.util.Properties properties
ProviderList apl
UUIDFactory uuidFactory
java.lang.String backingIndexName
UUID backingIndexUUID
ResultColumnList columnList
java.lang.String constraintText
ValueNode checkCondition
private int behavior
private int verifyType
public static final boolean DEFERRABLE_DEFAULT
public static final boolean INITIALLY_DEFERRED_DEFAULT
public static final boolean ENFORCED_DEFAULT
private boolean[] characteristics
ConstraintDefinitionNode(TableName constraintName, int constraintType, ResultColumnList rcl, java.util.Properties properties, ValueNode checkCondition, java.lang.String constraintText, int behavior, int verifyType, ContextManager cm)
void setCharacteristics(boolean[] cc)
boolean[] getCharacteristics()
public java.lang.String toString()
toString
in class TableElementNode
void bind(DDLStatementNode ddlNode, DataDictionary dd) throws StandardException
ddlNode
- the create or alter table nodedd
- the ddStandardException
- on errorjava.lang.String getConstraintMoniker()
java.lang.String getDropSchemaName()
UUID getBackingIndexUUID()
java.lang.String getBackingIndexName(DataDictionary dd)
void setAuxiliaryProviderList(ProviderList apl)
apl
- The new auxiliary provider list.ProviderList getAuxiliaryProviderList()
boolean hasPrimaryKeyConstraint()
hasPrimaryKeyConstraint
in class TableElementNode
boolean hasUniqueKeyConstraint()
hasUniqueKeyConstraint
in class TableElementNode
boolean hasForeignKeyConstraint()
hasForeignKeyConstraint
in class TableElementNode
boolean hasCheckConstraint()
hasCheckConstraint
in class TableElementNode
boolean hasConstraint()
hasConstraint
in class TableElementNode
boolean requiresBackingIndex()
true
if this constraint requires a backing
index, i.e. if is a foreign key, primary key or
unique key constraintboolean requiresUniqueIndex()
true
if this is a primary key or
unique key constraintint getConstraintType()
void setProperties(java.util.Properties properties)
properties
- The optional Properties for this constraint.java.util.Properties getProperties()
boolean isReferenced()
int getReferenceCount()
boolean isEnabled()
ResultColumnList getColumnList()
void setColumnList(ResultColumnList columnList)
columnList
- The new columnList.ValueNode getCheckCondition()
void setCheckCondition(ValueNode checkCondition)
checkCondition
- The check conditionjava.lang.String getConstraintText()
int getDropBehavior()
StatementType.DROP_CASCADE
etc.int getVerifyType()
private UUIDFactory getUUIDFactory()
void acceptChildren(Visitor v) throws StandardException
QueryTreeNode
accept(v)
on all visitable fields, as well as
super.acceptChildren(v)
to make sure all visitable fields
defined by the super-class are accepted too.acceptChildren
in class QueryTreeNode
v
- the visitorStandardException
- on errors raised by the visitorvoid qualifyNames() throws StandardException
StandardException
- if an error occursprivate static ModuleFactory getMonitor()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.