|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.iapi.sql.dictionary.TupleDescriptor
org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor
org.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor
org.apache.derby.iapi.sql.dictionary.ReferencedKeyConstraintDescriptor
public class ReferencedKeyConstraintDescriptor
A ReferencedConstraintDeescriptor is a primary key or a unique key that is referenced by a foreign key.
| Field Summary | |
|---|---|
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
|
| Fields inherited from class org.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor |
|---|
indexId |
| Fields inherited from class org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor |
|---|
ALL, constraintId, constraintName, DISABLED, ENABLED, isEnabled, SYSCONSTRAINTS_STATE_FIELD, table |
| Fields inherited from interface org.apache.derby.catalog.Dependable |
|---|
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 |
| Constructor Summary | |
|---|---|
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 isEnabled,
int referenceCount)
Constructor for a KeyConstraintDescriptorImpl |
| Method Summary | |
|---|---|
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 |
int |
getReferenceCount()
Get the number of enabled fks that reference this key. |
boolean |
hasNonSelfReferencingFK(int type)
Am I referenced by a FK on another table? |
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? |
| Methods inherited from class org.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor |
|---|
getConglomerateId, getIndexConglomerateDescriptor, getIndexId, getIndexUUIDString, hasBackingIndex, toString |
| Methods inherited from class org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor |
|---|
areColumnsComparable, columnIntersects, deferrable, doColumnsIntersect, drop, getClassType, getColumnDescriptors, getConstraintName, getConstraintText, getDependableFinder, getDescriptorName, getDescriptorType, getKeyColumns, getObjectID, getObjectName, getReferencedColumns, getSchemaDescriptor, getTableDescriptor, getTableId, getUUID, initiallyDeferred, isEnabled, isValid, makeInvalid, prepareToInvalidate, setDisabled, setEnabled |
| Methods inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor |
|---|
getColumnDependableFinder, getDataDictionary, getDependableFinder, isPersistent, setDataDictionary |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.derby.catalog.Dependable |
|---|
isPersistent |
| Field Detail |
|---|
private final int constraintType
int referenceCount
private ConstraintDescriptorList fkEnabledConstraintList
private ConstraintDescriptorList fkConstraintList
private boolean checkedSelfReferencing
private boolean hasSelfReferencing
| Constructor Detail |
|---|
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 isEnabled,
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 constraintisEnabled - is the constraint enabled?referenceCount - number of FKs (enabled only)| Method Detail |
|---|
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 error
public boolean hasNonSelfReferencingFK(int type)
throws StandardException
type - ConstraintDescriptor.(ENABLED|DISABLED|ALL)
StandardException - on error
public ConstraintDescriptorList getForeignKeyConstraints(int type)
throws StandardException
type - ConstraintDescriptor.(ENABLED|DISABLED|ALL)
StandardException - on errorpublic boolean isReferenced()
isReferenced in class ConstraintDescriptorpublic int getReferenceCount()
getReferenceCount in class ConstraintDescriptorpublic int incrementReferenceCount()
public int decrementReferenceCount()
public boolean needsToFire(int stmtType,
int[] modifiedCols)
needsToFire in class ConstraintDescriptorstmtType - the type of DML
(StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)modifiedCols - the columns modified, or null for all
private void checkType(int type)
throws StandardException
StandardException
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||