Class CheckConstraintDescriptor
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.CheckConstraintDescriptor
- All Implemented Interfaces:
Dependable
,Dependent
,Provider
This class represents a check constraint descriptor.
-
Field Summary
FieldsFields inherited from class org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor
ALL, constraintId, constraintName, DISABLED, ENABLED, SYSCONSTRAINTS_STATE_FIELD, 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
ConstructorsConstructorDescriptionCheckConstraintDescriptor
(DataDictionary dataDictionary, TableDescriptor table, String constraintName, boolean deferrable, boolean initiallyDeferred, UUID constraintId, String constraintText, ReferencedColumns referencedColumns, SchemaDescriptor schemaDesc, boolean isEnabled) -
Method Summary
Modifier and TypeMethodDescriptionGet the UUID of the backing index, if one exists.Get the text of the constraint.int
Gets an identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).int[]
Get the referenced columns as an int[] of column ids.Get the ReferencedColumns.boolean
Does this constraint have a backing index?boolean
needsToFire
(int stmtType, int[] modifiedCols) Does this constraint need to fire on this type of DML?void
Set the ReferencedColumns; used in drop columntoString()
Convert the CheckConstraintDescriptor to a String.Methods inherited from class org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor
areColumnsComparable, columnIntersects, deferrable, doColumnsIntersect, drop, enforced, getClassType, getColumnDescriptors, getConstraintName, getDependableFinder, getDescriptorName, getDescriptorType, getKeyColumns, getObjectID, getObjectName, getReferenceCount, getSchemaDescriptor, getTableDescriptor, getTableId, getUUID, initiallyDeferred, isReferenced, isValid, makeInvalid, prepareToInvalidate, setDeferrable, setEnforced, setInitiallyDeferred
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 Details
-
referencedColumns
-
constraintText
-
-
Constructor Details
-
CheckConstraintDescriptor
CheckConstraintDescriptor(DataDictionary dataDictionary, TableDescriptor table, String constraintName, boolean deferrable, boolean initiallyDeferred, UUID constraintId, String constraintText, ReferencedColumns referencedColumns, SchemaDescriptor schemaDesc, boolean isEnabled)
-
-
Method Details
-
hasBackingIndex
public boolean hasBackingIndex()Does this constraint have a backing index?- Specified by:
hasBackingIndex
in classConstraintDescriptor
- Returns:
- boolean Whether or not there is a backing index for this constraint.
-
getConstraintType
public int getConstraintType()Gets an identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).- Specified by:
getConstraintType
in classConstraintDescriptor
- Returns:
- An identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).
-
getConstraintText
Get the text of the constraint. (Only non-null/meaningful for check constraints.)- Overrides:
getConstraintText
in classConstraintDescriptor
- Returns:
- The constraint text.
-
getConglomerateId
Get the UUID of the backing index, if one exists.- Specified by:
getConglomerateId
in classConstraintDescriptor
- Returns:
- The UUID of the backing index, if one exists, else null.
-
getReferencedColumnsDescriptor
Get the ReferencedColumns.- Returns:
- The ReferencedColumns.
-
setReferencedColumnsDescriptor
Set the ReferencedColumns; used in drop column- Parameters:
rcd
- The new ReferencedColumns.
-
getReferencedColumns
public int[] getReferencedColumns()Get the referenced columns as an int[] of column ids.- Overrides:
getReferencedColumns
in classConstraintDescriptor
- Returns:
- The array of referenced column ids.
-
needsToFire
public boolean needsToFire(int stmtType, int[] modifiedCols) Does this constraint need to fire on this type of DML? For a check constraint, all inserts, and appropriate updates- Specified by:
needsToFire
in classConstraintDescriptor
- Parameters:
stmtType
- the type of DML (StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)modifiedCols
- the columns modified, or null for all- Returns:
- true/false
-
toString
Convert the CheckConstraintDescriptor to a String.- Overrides:
toString
in classConstraintDescriptor
- Returns:
- A String representation of this CheckConstraintDescriptor
-