public class ReferencedKeyConstraintDescriptor extends KeyConstraintDescriptor
Modifier and Type | Field and Description |
---|---|
private boolean |
checkedSelfReferencing |
private int |
constraintType
public interface to this descriptor:
public boolean hasSelfReferencingFK(ConstraintDescriptorList cdl, int type)
throws StandardException;
public ConstraintDescriptorList getForeignKeyConstraints(int type) throws StandardException;
public boolean isReferenced();
public int getReferenceCount();
public int incrementReferenceCount();
public int decrementReferenceCount();
|
private ConstraintDescriptorList |
fkConstraintList |
private ConstraintDescriptorList |
fkEnabledConstraintList |
private boolean |
hasSelfReferencing |
(package private) int |
referenceCount |
indexId
ALL, constraintId, constraintName, DISABLED, ENABLED, SYSCONSTRAINTS_STATE_FIELD, table
ACTIVATION, ALIAS, COLUMNS_IN_TABLE, COLUMNS_PERMISSION, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PERM, PREPARED_STATEMENT, ROLE_GRANT, ROUTINE_PERMISSION, SCHEMA, SEQUENCE, STORED_PREPARED_STATEMENT, TABLE, TABLE_PERMISSION, TRIGGER, VIEW
Modifier | Constructor and Description |
---|---|
protected |
ReferencedKeyConstraintDescriptor(int constraintType,
DataDictionary dataDictionary,
TableDescriptor table,
java.lang.String constraintName,
boolean deferrable,
boolean initiallyDeferred,
int[] columns,
UUID constraintId,
UUID indexId,
SchemaDescriptor schemaDesc,
boolean enforced,
int referenceCount)
Constructor for a KeyConstraintDescriptorImpl
|
Modifier and Type | Method and Description |
---|---|
private void |
checkType(int type) |
int |
decrementReferenceCount()
Decrement the reference count by one.
|
int |
getConstraintType()
Gets an identifier telling what type of descriptor it is
(UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).
|
ConstraintDescriptorList |
getForeignKeyConstraints(int type)
Get the referencing foreign key constraints
|
ConstraintDescriptorList |
getNonSelfReferencingFK(int type)
Am I referenced by a FK on another table?
|
int |
getReferenceCount()
Get the number of enforced fks that
reference this key.
|
boolean |
hasSelfReferencingFK(ConstraintDescriptorList cdl,
int type)
Am I referenced by a FK on the same table?
|
int |
incrementReferenceCount()
Bump the reference count by one.
|
boolean |
isReferenced()
Is this constraint referenced?
|
boolean |
needsToFire(int stmtType,
int[] modifiedCols)
Does this constraint need to fire on this type of
DML?
|
getConglomerateId, getIndexConglomerateDescriptor, getIndexId, getIndexUUIDString, hasBackingIndex, toString
areColumnsComparable, columnIntersects, deferrable, doColumnsIntersect, drop, enforced, getClassType, getColumnDescriptors, getConstraintName, getConstraintText, getDependableFinder, getDescriptorName, getDescriptorType, getKeyColumns, getObjectID, getObjectName, getReferencedColumns, getSchemaDescriptor, getTableDescriptor, getTableId, getUUID, initiallyDeferred, isValid, makeInvalid, prepareToInvalidate, setDeferrable, setEnforced, setInitiallyDeferred
getColumnDependableFinder, getDataDictionary, getDependableFinder, isPersistent, setDataDictionary
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isPersistent
private final int constraintType
int referenceCount
private ConstraintDescriptorList fkEnabledConstraintList
private ConstraintDescriptorList fkConstraintList
private boolean checkedSelfReferencing
private boolean hasSelfReferencing
protected ReferencedKeyConstraintDescriptor(int constraintType, DataDictionary dataDictionary, TableDescriptor table, java.lang.String constraintName, boolean deferrable, boolean initiallyDeferred, int[] columns, UUID constraintId, UUID indexId, SchemaDescriptor schemaDesc, boolean enforced, int referenceCount)
constraintType
- The type of the constraintdataDictionary
- The data dictionary that this descriptor lives intable
- The descriptor of the table the constraint is onconstraintName
- The name of the constraint.deferrable
- If the constraint can be deferred.initiallyDeferred
- If the constraint starts life deferred.columns
- columns involved in the constraintconstraintId
- UUID of constraintindexId
- The UUID for the backing indexschemaDesc
- The SchemaDescriptor for the constraintenforced
- is the constraint enforced?referenceCount
- number of FKs (enforced only)public final int getConstraintType()
ConstraintDescriptor
getConstraintType
in class ConstraintDescriptor
public boolean hasSelfReferencingFK(ConstraintDescriptorList cdl, int type) throws StandardException
cdl
- ConstraintDescriptorList for the tabletype
- ConstraintDescriptor.(ENABLED|DISABLED|ALL)StandardException
- on errorpublic ConstraintDescriptorList getNonSelfReferencingFK(int type) throws StandardException
type
- ConstraintDescriptor.(ENABLED|DISABLED|ALL)StandardException
- on errorpublic ConstraintDescriptorList getForeignKeyConstraints(int type) throws StandardException
type
- ConstraintDescriptor.(ENABLED|DISABLED|ALL)StandardException
- on errorpublic boolean isReferenced()
isReferenced
in class ConstraintDescriptor
public int getReferenceCount()
getReferenceCount
in class ConstraintDescriptor
public int incrementReferenceCount()
public int decrementReferenceCount()
public boolean needsToFire(int stmtType, int[] modifiedCols)
needsToFire
in class ConstraintDescriptor
stmtType
- the type of DML
(StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)modifiedCols
- the columns modified, or null for allprivate void checkType(int type) throws StandardException
StandardException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.