| java.lang.Object org.apache.derby.iapi.sql.dictionary.TupleDescriptor org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor
All known Subclasses: org.apache.derby.iapi.sql.dictionary.CheckConstraintDescriptor, org.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor,
ConstraintDescriptor | abstract public class ConstraintDescriptor extends TupleDescriptor implements UniqueTupleDescriptor,Provider,Dependent(Code) | | This class is used to get information from a ConstraintDescriptor.
A ConstraintDescriptor can represent a constraint on a table or on a
column.
version: 0.1 author: Jeff Lichtman |
Method Summary | |
public boolean | areColumnsComparable(ColumnDescriptorList otherColumns) Indicates whether the column descriptor list is
type comparable with the constraints columns. | public boolean | columnIntersects(int columnArray) | public boolean | deferrable() Returns TRUE if the constraint is deferrable
(we will probably not do deferrable constraints in the
initial release, but I want this to be part of the interface). | static boolean | doColumnsIntersect(int[] otherColumns, int[] referencedColumns) Does a column in the input set intersect with
our referenced columns?
Parameters: otherColumns - the columns to compare. | public String | getClassType() Get the provider's type. | public ColumnDescriptorList | getColumnDescriptors() Get the column descriptors for all the columns
referenced by this constraint. | abstract public UUID | getConglomerateId() | public String | getConstraintName() Gets the name of the constraint. | public String | getConstraintText() Get the text of the constraint. | abstract public int | getConstraintType() Gets an identifier telling what type of descriptor it is
(UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK). | public DependableFinder | getDependableFinder() | public String | getDescriptorName() | public String | getDescriptorType() | public int[] | getKeyColumns() RESOLVE: For now the ConstraintDescriptor code stores the array of key
columns in the field 'otherColumns'. | public UUID | getObjectID() | public String | getObjectName() Return the name of this Provider. | public int | getReferenceCount() Get the number of enabled fks that
reference this key. | public int[] | getReferencedColumns() Returns an array of column ids (i.e. | public SchemaDescriptor | getSchemaDescriptor() Get the SchemaDescriptor for the schema that this constraint
belongs to. | public TableDescriptor | getTableDescriptor() Get the table descriptor upon which this constraint
is declared. | public UUID | getTableId() Gets the UUID of the table the constraint is on. | public UUID | getUUID() Gets the UUID of the constraint. | abstract public boolean | hasBackingIndex() | public boolean | initiallyDeferred() Returns TRUE if the constraint is initially deferred
(we will probably not do initially deferred constraints
in the initial release, but I want this to be part of the interface). | public boolean | isEnabled() | public boolean | isReferenced() Is this constraint referenced? Return
false. | public synchronized boolean | isValid() Check that all of the dependent's dependencies are valid. | public void | makeInvalid(int action, LanguageConnectionContext lcc) Mark the dependent as invalid (due to at least one of
its dependencies being invalid). | public void | makeValid(LanguageConnectionContext lcc) Attempt to revalidate the dependent. | abstract public boolean | needsToFire(int stmtType, int[] modifiedCols) | public void | prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) Prepare to mark the dependent as invalid (due to at least one of
its dependencies being invalid). | public void | setDisabled() Set the constraint to disabled. | public void | setEnabled() Set the constraint to enabled. | public String | toString() Convert the ColumnDescriptor to a String. |
ALL | final public static int ALL(Code) | | |
DISABLED | final public static int DISABLED(Code) | | |
ENABLED | final public static int ENABLED(Code) | | |
SYSCONSTRAINTS_STATE_FIELD | final public static int SYSCONSTRAINTS_STATE_FIELD(Code) | | |
isEnabled | boolean isEnabled(Code) | | |
ConstraintDescriptor | ConstraintDescriptor(DataDictionary dataDictionary, TableDescriptor table, String constraintName, boolean deferrable, boolean initiallyDeferred, int[] referencedColumns, UUID constraintId, SchemaDescriptor schemaDesc, boolean isEnabled)(Code) | | Constructor for a ConstraintDescriptor
Parameters: dataDictionary - The data dictionary that this descriptor lives in Parameters: table - The descriptor of the table the constraint is on Parameters: constraintName - The name of the constraint. Parameters: deferrable - If the constraint can be deferred. Parameters: initiallyDeferred - If the constraint starts life deferred. Parameters: referencedColumns - columns that the constraint references Parameters: constraintId - UUID of constraint Parameters: schemaDesc - SchemaDescriptor |
areColumnsComparable | public boolean areColumnsComparable(ColumnDescriptorList otherColumns) throws StandardException(Code) | | Indicates whether the column descriptor list is
type comparable with the constraints columns. The
types have to be identical AND in the same order
to succeed.
Parameters: otherColumns - the columns to compare true/false exception: StandardException - on error |
columnIntersects | public boolean columnIntersects(int columnArray)(Code) | | Does a column intersect with our referenced columns
Parameters: columnArray - columns to checkNote-- this is not a static method. |
deferrable | public boolean deferrable()(Code) | | Returns TRUE if the constraint is deferrable
(we will probably not do deferrable constraints in the
initial release, but I want this to be part of the interface).
TRUE if the constraint is deferrable, FALSE if not |
doColumnsIntersect | static boolean doColumnsIntersect(int[] otherColumns, int[] referencedColumns)(Code) | | Does a column in the input set intersect with
our referenced columns?
Parameters: otherColumns - the columns to compare. Ifnull, asssumed to mean all columns Parameters: referencedColumns - the columns referenced by the caller true/false |
getClassType | public String getClassType()(Code) | | Get the provider's type.
char The provider's type. |
getConglomerateId | abstract public UUID getConglomerateId()(Code) | | |
getConstraintName | public String getConstraintName()(Code) | | Gets the name of the constraint.
A String containing the name of the constraint. |
getConstraintText | public String getConstraintText()(Code) | | Get the text of the constraint. (Only non-null/meaningful for check
constraints.)
The constraint text. |
getConstraintType | abstract public int getConstraintType()(Code) | | Gets an identifier telling what type of descriptor it is
(UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).
An identifier telling what type of descriptor it is(UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK). |
getKeyColumns | public int[] getKeyColumns()(Code) | | RESOLVE: For now the ConstraintDescriptor code stores the array of key
columns in the field 'otherColumns'. Jerry plans to re-organize things.
For now to minimize his rototill I've implemented this function on the
old structures. All new code should use getKeyColumns to get a constraint's
key columns.
See Also: org.apache.derby.iapi.sql.dictionary.KeyConstraintDescriptor.getKeyColumns |
getObjectID | public UUID getObjectID()(Code) | | Get the provider's UUID
The provider's UUID |
getObjectName | public String getObjectName()(Code) | | Return the name of this Provider. (Useful for errors.)
String The name of this provider. |
getReferenceCount | public int getReferenceCount()(Code) | | Get the number of enabled fks that
reference this key. Overriden by
ReferencedKeyConstraints.
the number of fks |
getReferencedColumns | public int[] getReferencedColumns()(Code) | | Returns an array of column ids (i.e. ordinal positions) for
the columns referenced in this table for a primary key, unique
key, referential, or check constraint.
An array of column ids for those constraints that canbe on columns (primary, unique key, referentialconstraints, and check constraints). For check andunique constraints, it returns an array of columns idsthat are referenced in the constraint. For primary keyand referential constraints, it returns an array ofcolumn ids for the columns in this table (i.e. theprimary key columns for a primary key constraint,and the foreign key columns for a foreign keyconstraint. |
getSchemaDescriptor | public SchemaDescriptor getSchemaDescriptor()(Code) | | Get the SchemaDescriptor for the schema that this constraint
belongs to.
SchemaDescriptor The SchemaDescriptor for this constraint. |
getTableDescriptor | public TableDescriptor getTableDescriptor()(Code) | | Get the table descriptor upon which this constraint
is declared.
the table descriptor |
getTableId | public UUID getTableId()(Code) | | Gets the UUID of the table the constraint is on.
The UUID of the table the constraint is on. |
getUUID | public UUID getUUID()(Code) | | Gets the UUID of the constraint.
The UUID of the constraint. |
hasBackingIndex | abstract public boolean hasBackingIndex()(Code) | | Does this constraint have a backing index?
boolean Whether or not there is a backing index for this constraint. |
initiallyDeferred | public boolean initiallyDeferred()(Code) | | Returns TRUE if the constraint is initially deferred
(we will probably not do initially deferred constraints
in the initial release, but I want this to be part of the interface).
TRUE if the constraint is initially deferred,FALSE if not |
isEnabled | public boolean isEnabled()(Code) | | Is this constraint active?
true/false |
isReferenced | public boolean isReferenced()(Code) | | Is this constraint referenced? Return
false. Overridden by ReferencedKeyConstraints.
false |
isValid | public synchronized boolean isValid()(Code) | | Check that all of the dependent's dependencies are valid.
true if the dependent is currently valid |
makeInvalid | public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException(Code) | | Mark the dependent as invalid (due to at least one of
its dependencies being invalid). Always an error
for a constraint -- should never have gotten here.
Parameters: action - The action causing the invalidation exception: StandardException - thrown if called in sanity mode |
needsToFire | abstract public boolean needsToFire(int stmtType, int[] modifiedCols)(Code) | | Does this constraint need to fire on this type of
DML?
Parameters: stmtType - the type of DML (StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE) Parameters: modifiedCols - the columns modified, or null for all true/false |
prepareToInvalidate | public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException(Code) | | Prepare to mark the dependent as invalid (due to at least one of
its dependencies being invalid).
Parameters: action - The action causing the invalidation Parameters: p - the provider exception: StandardException - thrown if unable to make it invalid |
setDisabled | public void setDisabled()(Code) | | Set the constraint to disabled.
Does not update the data dictionary
|
setEnabled | public void setEnabled()(Code) | | Set the constraint to enabled.
Does not update the data dictionary
|
toString | public String toString()(Code) | | Convert the ColumnDescriptor to a String.
A String representation of this ColumnDescriptor |
|
|