Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.iapi.sql.dictionary
Class ForeignKeyConstraintDescriptor  view ForeignKeyConstraintDescriptor download ForeignKeyConstraintDescriptor.java

java.lang.Object
  extended byorg.apache.derby.iapi.sql.dictionary.TupleDescriptor
      extended byorg.apache.derby.iapi.sql.dictionary.ConstraintDescriptor
          extended byorg.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor
              extended byorg.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.


Field Summary
(package private)  int raDeleteRule
           
(package private)  int raUpdateRule
           
(package private)  ReferencedKeyConstraintDescriptor referencedConstraintDescriptor
          interface to this descriptor public ReferencedKeyConstraintDescriptor getReferencedConstraint() throws StandardException; public UUID getReferencedConstraintId() throws StandardException; public boolean isSelfReferencingFK() throws StandardException;
(package private)  org.apache.derby.catalog.UUID referencedConstraintId
           
 
Fields inherited from class org.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor
indexId
 
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 class org.apache.derby.iapi.sql.dictionary.TupleDescriptor
COLUMN_LIST, CONGLOMERATE_LIST, CONSTRAINT_LIST, TRIGGER_LIST
 
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
 
Method Summary
 int getConstraintType()
          Gets an identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).
 int getRaDeleteRule()
          Gets a referential action rule on a DELETE
 int getRaUpdateRule()
          Gets a referential action rule on a UPDATE
 ReferencedKeyConstraintDescriptor getReferencedConstraint()
          Get the constraint that this FK references.
 org.apache.derby.catalog.UUID getReferencedConstraintId()
          Get the constraint id for the constraint that this FK references.
 boolean isSelfReferencingFK()
          Am I a self-referencing FK? True if my referenced constraint is on the same table as me.
 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
 
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, 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
 
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

referencedConstraintDescriptor

ReferencedKeyConstraintDescriptor referencedConstraintDescriptor
interface to this descriptor
  1. public ReferencedKeyConstraintDescriptor getReferencedConstraint() throws StandardException;
  2. public UUID getReferencedConstraintId() throws StandardException;
  3. public boolean isSelfReferencingFK() throws StandardException;


referencedConstraintId

org.apache.derby.catalog.UUID referencedConstraintId

raDeleteRule

int raDeleteRule

raUpdateRule

int raUpdateRule
Constructor Detail

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

Method Detail

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