java.lang.Object
org.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.ForeignKeyConstraintDescriptor
- All Implemented Interfaces:
- org.apache.derby.catalog.Dependable, org.apache.derby.iapi.sql.depend.Dependent, org.apache.derby.iapi.sql.depend.Provider, UniqueTupleDescriptor
- public class ForeignKeyConstraintDescriptor
- extends KeyConstraintDescriptor
A foreign key.
| Fields inherited from class org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor |
ALL, colDL, constraintId, constraintName, deferrable, DISABLED, ENABLED, initiallyDeferred, isEnabled, referencedColumns, schemaDesc, SYSCONSTRAINTS_STATE_FIELD, table |
| Fields inherited from interface org.apache.derby.catalog.Dependable |
ALIAS, COLUMNS_IN_TABLE, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PREPARED_STATEMENT, SCHEMA, STORED_PREPARED_STATEMENT, TABLE, TRIGGER, VIEW |
|
Constructor Summary |
protected |
ForeignKeyConstraintDescriptor(DataDictionary dataDictionary,
TableDescriptor table,
java.lang.String constraintName,
boolean deferrable,
boolean initiallyDeferred,
int[] fkColumns,
org.apache.derby.catalog.UUID constraintId,
org.apache.derby.catalog.UUID indexId,
SchemaDescriptor schemaDesc,
ReferencedKeyConstraintDescriptor referencedConstraintDescriptor,
boolean isEnabled,
int raDeleteRule,
int raUpdateRule)
Constructor for a ForeignKeyConstraintDescriptor |
(package private) |
ForeignKeyConstraintDescriptor(DataDictionary dataDictionary,
TableDescriptor table,
java.lang.String constraintName,
boolean deferrable,
boolean initiallyDeferred,
int[] fkColumns,
org.apache.derby.catalog.UUID constraintId,
org.apache.derby.catalog.UUID indexId,
SchemaDescriptor schemaDesc,
org.apache.derby.catalog.UUID referencedConstraintId,
boolean isEnabled,
int raDeleteRule,
int raUpdateRule)
Constructor for a ForeignKeyConstraintDescriptor |
| Methods inherited from class org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor |
areColumnsComparable, columnIntersects, deferrable, doColumnsIntersect, getClassType, getColumnDescriptors, getConstraintName, getConstraintText, getDependableFinder, getDescriptorName, getDescriptorType, getKeyColumns, getObjectID, getObjectName, getReferenceCount, getReferencedColumns, getSchemaDescriptor, getTableDescriptor, getTableId, getUUID, initiallyDeferred, isEnabled, isReferenced, isValid, makeInvalid, makeValid, prepareToInvalidate, setConstraintId, setDisabled, setEnabled |
referencedConstraintDescriptor
ReferencedKeyConstraintDescriptor referencedConstraintDescriptor
- interface to this descriptor
- public ReferencedKeyConstraintDescriptor getReferencedConstraint()
throws StandardException;
- public UUID getReferencedConstraintId()
throws StandardException;
- public boolean isSelfReferencingFK()
throws StandardException;
referencedConstraintId
org.apache.derby.catalog.UUID referencedConstraintId
raDeleteRule
int raDeleteRule
raUpdateRule
int raUpdateRule
ForeignKeyConstraintDescriptor
protected ForeignKeyConstraintDescriptor(DataDictionary dataDictionary,
TableDescriptor table,
java.lang.String constraintName,
boolean deferrable,
boolean initiallyDeferred,
int[] fkColumns,
org.apache.derby.catalog.UUID constraintId,
org.apache.derby.catalog.UUID indexId,
SchemaDescriptor schemaDesc,
ReferencedKeyConstraintDescriptor referencedConstraintDescriptor,
boolean isEnabled,
int raDeleteRule,
int raUpdateRule)
- Constructor for a ForeignKeyConstraintDescriptor
ForeignKeyConstraintDescriptor
ForeignKeyConstraintDescriptor(DataDictionary dataDictionary,
TableDescriptor table,
java.lang.String constraintName,
boolean deferrable,
boolean initiallyDeferred,
int[] fkColumns,
org.apache.derby.catalog.UUID constraintId,
org.apache.derby.catalog.UUID indexId,
SchemaDescriptor schemaDesc,
org.apache.derby.catalog.UUID referencedConstraintId,
boolean isEnabled,
int raDeleteRule,
int raUpdateRule)
- Constructor for a ForeignKeyConstraintDescriptor
getReferencedConstraint
public ReferencedKeyConstraintDescriptor getReferencedConstraint()
throws org.apache.derby.iapi.error.StandardException
- Get the constraint that this FK references. Will
return either a primary key or a unique key constriant.
getReferencedConstraintId
public org.apache.derby.catalog.UUID getReferencedConstraintId()
throws org.apache.derby.iapi.error.StandardException
- Get the constraint id for the constraint that this FK references.
Will return either a primary key or a unique key constriant.
getConstraintType
public int getConstraintType()
- Gets an identifier telling what type of descriptor it is
(UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).
- Specified by:
getConstraintType in class ConstraintDescriptor
needsToFire
public boolean needsToFire(int stmtType,
int[] modifiedCols)
- Does this constraint need to fire on this type of
DML? True if insert or update and columns intersect
- Specified by:
needsToFire in class ConstraintDescriptor
isSelfReferencingFK
public boolean isSelfReferencingFK()
throws org.apache.derby.iapi.error.StandardException
- Am I a self-referencing FK? True if my referenced
constraint is on the same table as me.
getRaDeleteRule
public int getRaDeleteRule()
- Gets a referential action rule on a DELETE
getRaUpdateRule
public int getRaUpdateRule()
- Gets a referential action rule on a UPDATE