org.apache.derby.iapi.sql.dictionary
Class ForeignKeyConstraintDescriptor
- java.lang.Object
-
- org.apache.derby.iapi.sql.dictionary.TupleDescriptor
-
- org.apache.derby.iapi.sql.dictionary.UniqueTupleDescriptor
-
- org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor
-
- org.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor
-
- org.apache.derby.iapi.sql.dictionary.ForeignKeyConstraintDescriptor
-
- All Implemented Interfaces:
- Dependable, Dependent, Provider
public class ForeignKeyConstraintDescriptor extends KeyConstraintDescriptor
A foreign key.
-
-
Field Summary
-
Fields inherited from class org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor
ALL, DISABLED, ENABLED, SYSCONSTRAINTS_STATE_FIELD
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetConstraintType()Gets an identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).intgetRaDeleteRule()Gets a referential action rule on a DELETEintgetRaUpdateRule()Gets a referential action rule on a UPDATEReferencedKeyConstraintDescriptorgetReferencedConstraint()Get the constraint that this FK references.UUIDgetReferencedConstraintId()Get the constraint id for the constraint that this FK references.booleanisSelfReferencingFK()Am I a self-referencing FK? True if my referenced constraint is on the same table as me.booleanneedsToFire(int stmtType, int[] modifiedCols)Does this constraint need to fire on this type of DML? True if insert or update and columns intersect-
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, drop, enforced, getClassType, getColumnDescriptors, getConstraintName, getConstraintText, getDependableFinder, getDescriptorName, getDescriptorType, getKeyColumns, getObjectID, getObjectName, getReferenceCount, getReferencedColumns, getSchemaDescriptor, getTableDescriptor, getTableId, getUUID, initiallyDeferred, isReferenced, isValid, makeInvalid, prepareToInvalidate, setDeferrable, setEnforced, setInitiallyDeferred
-
Methods inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor
isPersistent
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.derby.catalog.Dependable
isPersistent
-
-
-
-
Method Detail
-
getReferencedConstraint
public ReferencedKeyConstraintDescriptor getReferencedConstraint() throws StandardException
Get the constraint that this FK references. Will return either a primary key or a unique key constraint.- Returns:
- the constraint
- Throws:
StandardException- on error
-
getReferencedConstraintId
public UUID getReferencedConstraintId() throws StandardException
Get the constraint id for the constraint that this FK references. Will return either a primary key or a unique key constriant.- Returns:
- the constraint id
- Throws:
StandardException- on error
-
getConstraintType
public int getConstraintType()
Gets an identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).- Specified by:
getConstraintTypein classConstraintDescriptor- Returns:
- An identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).
-
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:
needsToFirein classConstraintDescriptor- Parameters:
stmtType- the type of DML (StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)modifiedCols- the columns modified, or null for all- Returns:
- true/false
-
isSelfReferencingFK
public boolean isSelfReferencingFK() throws StandardExceptionAm I a self-referencing FK? True if my referenced constraint is on the same table as me.- Returns:
- true/false
- Throws:
StandardException- on error
-
getRaDeleteRule
public int getRaDeleteRule()
Gets a referential action rule on a DELETE- Returns:
- referential rule defined by the user during foreign key creattion for a delete (like CASCDE , RESTRICT ..etc)
-
getRaUpdateRule
public int getRaUpdateRule()
Gets a referential action rule on a UPDATE- Returns:
- referential rule defined by the user during foreign key creattion for an UPDATE (like CASCDE , RESTRICT ..etc)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG