|
|||||||||
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
public abstract class ConstraintDescriptor
This class is used to get information from a ConstraintDescriptor. A ConstraintDescriptor can represent a constraint on a table or on a column.
Field Summary | |
---|---|
static int |
ALL
|
private ColumnDescriptorList |
colDL
|
(package private) UUID |
constraintId
|
(package private) java.lang.String |
constraintName
|
private boolean |
deferrable
|
static int |
DISABLED
|
static int |
ENABLED
|
private boolean |
initiallyDeferred
|
(package private) boolean |
isEnabled
|
private int[] |
referencedColumns
|
private SchemaDescriptor |
schemaDesc
|
static int |
SYSCONSTRAINTS_STATE_FIELD
|
(package private) TableDescriptor |
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 | |
---|---|
ConstraintDescriptor(DataDictionary dataDictionary,
TableDescriptor table,
java.lang.String constraintName,
boolean deferrable,
boolean initiallyDeferred,
int[] referencedColumns,
UUID constraintId,
SchemaDescriptor schemaDesc,
boolean isEnabled)
Constructor for a ConstraintDescriptor |
Method Summary | |
---|---|
boolean |
areColumnsComparable(ColumnDescriptorList otherColumns)
Indicates whether the column descriptor list is type comparable with the constraints columns. |
boolean |
columnIntersects(int[] columnArray)
Does a column intersect with our referenced columns |
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). |
(package private) static boolean |
doColumnsIntersect(int[] otherColumns,
int[] referencedColumns)
Does a column in the input set intersect with our referenced columns? |
ConglomerateDescriptor |
drop(LanguageConnectionContext lcc,
boolean clearDependencies)
Drop the constraint. |
java.lang.String |
getClassType()
Get the provider's type. |
ColumnDescriptorList |
getColumnDescriptors()
Get the column descriptors for all the columns referenced by this constraint. |
abstract UUID |
getConglomerateId()
|
java.lang.String |
getConstraintName()
Gets the name of the constraint. |
java.lang.String |
getConstraintText()
Get the text of the constraint. |
abstract int |
getConstraintType()
Gets an identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK). |
DependableFinder |
getDependableFinder()
Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable. |
java.lang.String |
getDescriptorName()
|
java.lang.String |
getDescriptorType()
Each descriptor must identify itself with its type; i.e index, check constraint whatever. |
int[] |
getKeyColumns()
RESOLVE: For now the ConstraintDescriptor code stores the array of key columns in the field 'otherColumns'. |
UUID |
getObjectID()
Get the provider's UUID |
java.lang.String |
getObjectName()
Return the name of this Provider. |
int |
getReferenceCount()
Get the number of enabled fks that reference this key. |
int[] |
getReferencedColumns()
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. |
SchemaDescriptor |
getSchemaDescriptor()
Get the SchemaDescriptor for the schema that this constraint belongs to. |
TableDescriptor |
getTableDescriptor()
Get the table descriptor upon which this constraint is declared. |
UUID |
getTableId()
Gets the UUID of the table the constraint is on. |
UUID |
getUUID()
Gets the UUID of the constraint. |
abstract boolean |
hasBackingIndex()
Does this constraint have a backing index? |
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). |
boolean |
isEnabled()
Is this constraint active? |
boolean |
isReferenced()
Is this constraint referenced? |
boolean |
isValid()
Check that all of the dependent's dependencies are valid. |
void |
makeInvalid(int action,
LanguageConnectionContext lcc)
Mark the dependent as invalid (due to at least one of its dependencies being invalid). |
abstract boolean |
needsToFire(int stmtType,
int[] modifiedCols)
Does this constraint need to fire on this type of DML? |
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). |
void |
setDisabled()
Set the constraint to disabled. |
void |
setEnabled()
Set the constraint to enabled. |
java.lang.String |
toString()
Convert the ColumnDescriptor to a String. |
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 |
---|
public static final int ENABLED
public static final int DISABLED
public static final int ALL
public static final int SYSCONSTRAINTS_STATE_FIELD
TableDescriptor table
final java.lang.String constraintName
private final boolean deferrable
private final boolean initiallyDeferred
boolean isEnabled
private final int[] referencedColumns
final UUID constraintId
private final SchemaDescriptor schemaDesc
private ColumnDescriptorList colDL
Constructor Detail |
---|
ConstraintDescriptor(DataDictionary dataDictionary, TableDescriptor table, java.lang.String constraintName, boolean deferrable, boolean initiallyDeferred, int[] referencedColumns, UUID constraintId, SchemaDescriptor schemaDesc, boolean isEnabled)
dataDictionary
- 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.referencedColumns
- columns that the constraint referencesconstraintId
- UUID of constraintschemaDesc
- SchemaDescriptorMethod Detail |
---|
public UUID getTableId()
public UUID getUUID()
getUUID
in interface UniqueTupleDescriptor
public java.lang.String getConstraintName()
public abstract int getConstraintType()
public abstract UUID getConglomerateId()
public java.lang.String getConstraintText()
public boolean deferrable()
public boolean initiallyDeferred()
public int[] getReferencedColumns()
public abstract boolean hasBackingIndex()
public SchemaDescriptor getSchemaDescriptor()
public int[] getKeyColumns()
getKeyColumns()
public boolean isEnabled()
public void setEnabled()
public void setDisabled()
public boolean isReferenced()
public int getReferenceCount()
public abstract boolean needsToFire(int stmtType, int[] modifiedCols)
stmtType
- the type of DML
(StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)modifiedCols
- the columns modified, or null for all
public TableDescriptor getTableDescriptor()
public ColumnDescriptorList getColumnDescriptors() throws StandardException
StandardException
- on errorpublic boolean areColumnsComparable(ColumnDescriptorList otherColumns) throws StandardException
otherColumns
- the columns to compare
StandardException
- on errorpublic boolean columnIntersects(int[] columnArray)
columnArray
- columns to check
Note-- this is not a static method.static boolean doColumnsIntersect(int[] otherColumns, int[] referencedColumns)
otherColumns
- the columns to compare. If
null, asssumed to mean all columnsreferencedColumns
- the columns referenced by the caller
public java.lang.String toString()
toString
in class java.lang.Object
public DependableFinder getDependableFinder()
Dependable
getDependableFinder
in interface Dependable
Dependable.getDependableFinder()
public java.lang.String getObjectName()
getObjectName
in interface Dependable
public UUID getObjectID()
getObjectID
in interface Dependable
public java.lang.String getClassType()
getClassType
in interface Dependable
public boolean isValid()
isValid
in interface Dependent
public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException
prepareToInvalidate
in interface Dependent
action
- The action causing the invalidationp
- the providerlcc
- The LanguageConnectionContext
StandardException
- thrown if unable to make it invalidpublic void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException
makeInvalid
in interface Dependent
action
- The action causing the invalidationlcc
- The LanguageConnectionContext
StandardException
- thrown if called in sanity modepublic ConglomerateDescriptor drop(LanguageConnectionContext lcc, boolean clearDependencies) throws StandardException
StandardException
public java.lang.String getDescriptorName()
getDescriptorName
in class TupleDescriptor
TupleDescriptor.getDescriptorName()
public java.lang.String getDescriptorType()
TupleDescriptor
getDescriptorType
in class TupleDescriptor
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |