Top Description Fields Constructors Methods
org.apache.derby.iapi.sql.dictionary

public Class CheckConstraintDescriptor

extends ConstraintDescriptor
Class Inheritance
Imports
org.apache.derby.catalog.ReferencedColumns, .UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.StatementType, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.store.access.TransactionController

This class represents a check constraint descriptor.

Field Summary

Modifier and TypeField and Description
private String
private ReferencedColumns
Inherited from org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor:
ALLconstraintIdconstraintNameDISABLEDENABLEDSYSCONSTRAINTS_STATE_FIELDtable

Constructor Summary

AccessConstructor and Description
pack-priv
CheckConstraintDescriptor(DataDictionary dataDictionary, TableDescriptor table, String constraintName, boolean deferrable, boolean initiallyDeferred, UUID constraintId, String constraintText, ReferencedColumns referencedColumns, SchemaDescriptor schemaDesc, boolean isEnabled)

Method Summary

Modifier and TypeMethod and Description
public UUID

Returns:

The UUID of the backing index, if one exists, else null.
getConglomerateId
()

Implements abstract org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.getConglomerateId.

Get the UUID of the backing index, if one exists.

public String

Returns:

The constraint text.
getConstraintText
()

Overrides org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.getConstraintText.

Get the text of the constraint.

public int

Returns:

An identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).
getConstraintType
()

Implements abstract org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.getConstraintType.

Gets an identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).

public int[]

Returns:

The array of referenced column ids.
getReferencedColumns
()

Overrides org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.getReferencedColumns.

Get the referenced columns as an int[] of column ids.

public ReferencedColumns

Returns:

The ReferencedColumns.
getReferencedColumnsDescriptor
()

Get the ReferencedColumns.

public boolean

Returns:

boolean Whether or not there is a backing index for this constraint.
hasBackingIndex
()

Implements abstract org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.hasBackingIndex.

Does this constraint have a backing index?

public boolean

Returns:

true/false
needsToFire
(int
the type of DML (StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)
stmtType
,
int[]
the columns modified, or null for all
modifiedCols
)

Implements abstract org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.needsToFire.

Does this constraint need to fire on this type of DML?

public void
setReferencedColumnsDescriptor(ReferencedColumns
The new ReferencedColumns.
rcd
)

Set the ReferencedColumns; used in drop column

public String

Returns:

A String representation of this CheckConstraintDescriptor
toString
()

Overrides org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.toString.

Convert the CheckConstraintDescriptor to a String.

Inherited from org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor:
areColumnsComparablecolumnIntersectsdeferrabledoColumnsIntersectdropenforcedgetClassTypegetColumnDescriptorsgetConstraintNamegetDependableFindergetDescriptorNamegetDescriptorTypegetKeyColumnsgetObjectIDgetObjectNamegetReferenceCountgetSchemaDescriptorgetTableDescriptorgetTableIdgetUUIDinitiallyDeferredisReferencedisValidmakeInvalidprepareToInvalidatesetDeferrablesetEnforcedsetInitiallyDeferred

Field Detail

constraintTextback to summary
private String constraintText
referencedColumnsback to summary
private ReferencedColumns referencedColumns

Hides org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.referencedColumns.

Constructor Detail

CheckConstraintDescriptorback to summary
pack-priv CheckConstraintDescriptor(DataDictionary dataDictionary, TableDescriptor table, String constraintName, boolean deferrable, boolean initiallyDeferred, UUID constraintId, String constraintText, ReferencedColumns referencedColumns, SchemaDescriptor schemaDesc, boolean isEnabled)

Method Detail

getConglomerateIdback to summary
public UUID getConglomerateId()

Implements abstract org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.getConglomerateId.

Get the UUID of the backing index, if one exists.

Returns:UUID

The UUID of the backing index, if one exists, else null.

getConstraintTextback to summary
public String getConstraintText()

Overrides org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.getConstraintText.

Get the text of the constraint. (Only non-null/meaningful for check constraints.)

Returns:String

The constraint text.

getConstraintTypeback to summary
public int getConstraintType()

Implements abstract org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.getConstraintType.

Gets an identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).

Returns:int

An identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).

getReferencedColumnsback to summary
public int[] getReferencedColumns()

Overrides org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.getReferencedColumns.

Get the referenced columns as an int[] of column ids.

Returns:int[]

The array of referenced column ids.

getReferencedColumnsDescriptorback to summary
public ReferencedColumns getReferencedColumnsDescriptor()

Get the ReferencedColumns.

Returns:ReferencedColumns

The ReferencedColumns.

hasBackingIndexback to summary
public boolean hasBackingIndex()

Implements abstract org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.hasBackingIndex.

Does this constraint have a backing index?

Returns:boolean

boolean Whether or not there is a backing index for this constraint.

needsToFireback to summary
public boolean needsToFire(int stmtType, int[] modifiedCols)

Implements abstract org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.needsToFire.

Does this constraint need to fire on this type of DML? For a check constraint, all inserts, and appropriate updates

Parameters
stmtType:int

the type of DML (StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)

modifiedCols:int[]

the columns modified, or null for all

Returns:boolean

true/false

setReferencedColumnsDescriptorback to summary
public void setReferencedColumnsDescriptor(ReferencedColumns rcd)

Set the ReferencedColumns; used in drop column

Parameters
rcd:ReferencedColumns

The new ReferencedColumns.

toStringback to summary
public String toString()

Overrides org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.toString.

Convert the CheckConstraintDescriptor to a String.

Returns:String

A String representation of this CheckConstraintDescriptor