Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class ConstraintInfo

extends Object
implements ConsInfo
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.dictionary.ConsInfo, org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable
Imports
org.apache.derby.iapi.sql.dictionary.ConsInfo, .DataDictionary, .SchemaDescriptor, .TableDescriptor, org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.io.StoredFormatIds, org.apache.derby.shared.common.util.ArrayUtil, org.apache.derby.shared.common.sanity.SanityManager, java.io.ObjectOutput, .ObjectInput, .IOException

This is a simple class used to store the run time information about a constraint.

Field Summary

Modifier and TypeField and Description
private String[]
private int
private int
private String
tableName

This class implements Formatable.

private UUID
private SchemaDescriptor

Constructor Summary

AccessConstructor and Description
public
ConstraintInfo()

Niladic constructor for Formattable

public
ConstraintInfo(String tableName, SchemaDescriptor tableSd, String[] columnNames, int raDeleteRule, int raUpdateRule)

Consructor

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

array of referenced column names
getReferencedColumnNames
()

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedColumnNames.

This ConsInfo describes columns in a referenced table.

public TableDescriptor
getReferencedTableDescriptor(DataDictionary
data dictionary to search for table
dd
)

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedTableDescriptor.

This ConsInfo describes columns in a referenced table.

public String

Returns:

referenced table name
getReferencedTableName
()

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedTableName.

Get the name of the table that these column live in.

public SchemaDescriptor
getReferencedTableSchemaDescriptor(DataDictionary
data dictionary to search for schema
dd
)

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedTableSchemaDescriptor.

This ConsInfo describes columns in a referenced table.

public int

Returns:

referential Action Delete rule
getReferentialActionDeleteRule
()

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferentialActionDeleteRule.

Get the referential Action for a Delete.

public int

Returns:

referential Action for update
getReferentialActionUpdateRule
()

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferentialActionUpdateRule.

Get the referential Action for an Update.

public int

Returns:

the formatID of this class
getTypeFormatId
()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

public void
readExternal(ObjectInput
read this.
in
)

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
writeExternal(ObjectOutput
write bytes here
out
)

Implements java.io.Externalizable.writeExternal.

Write this object out

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

columnNamesback to summary
private String[] columnNames
raDeleteRuleback to summary
private int raDeleteRule
raUpdateRuleback to summary
private int raUpdateRule
tableNameback to summary
private String tableName

This class implements Formatable. That means that it can write itself to and from a formatted stream. If you add more fields to this class, make sure that you also write/read them with the writeExternal()/readExternal() methods. If, inbetween releases, you add more fields to this class, then you should bump the version number emitted by the getTypeFormatId() method. OR, since this is something that is used in stored prepared statements, it is ok to change it if you make sure that stored prepared statements are invalidated across releases.

tableSchemaIdback to summary
private UUID tableSchemaId
tableSdback to summary
private SchemaDescriptor tableSd

Constructor Detail

ConstraintInfoback to summary
public ConstraintInfo()

Niladic constructor for Formattable

ConstraintInfoback to summary
public ConstraintInfo(String tableName, SchemaDescriptor tableSd, String[] columnNames, int raDeleteRule, int raUpdateRule)

Consructor

Method Detail

getReferencedColumnNamesback to summary
public String[] getReferencedColumnNames()

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedColumnNames.

This ConsInfo describes columns in a referenced table. What are their names?

Returns:String[]

array of referenced column names

getReferencedTableDescriptorback to summary
public TableDescriptor getReferencedTableDescriptor(DataDictionary dd) throws StandardException

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedTableDescriptor.

Doc from org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedTableDescriptor.

This ConsInfo describes columns in a referenced table. What is that table?

Parameters
dd:DataDictionary

data dictionary to search for table

Returns:TableDescriptor

referenced table

Exceptions
StandardException:
thrown on oops
getReferencedTableNameback to summary
public String getReferencedTableName()

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedTableName.

Get the name of the table that these column live in.

Returns:String

referenced table name

getReferencedTableSchemaDescriptorback to summary
public SchemaDescriptor getReferencedTableSchemaDescriptor(DataDictionary dd) throws StandardException

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedTableSchemaDescriptor.

Doc from org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferencedTableSchemaDescriptor.

This ConsInfo describes columns in a referenced table. What is the schema that the referenced table lives in?

Parameters
dd:DataDictionary

data dictionary to search for schema

Returns:SchemaDescriptor

schema that referenced table lives in

Exceptions
StandardException:
thrown on oops
getReferentialActionDeleteRuleback to summary
public int getReferentialActionDeleteRule()

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferentialActionDeleteRule.

Get the referential Action for a Delete.

Returns:int

referential Action Delete rule

getReferentialActionUpdateRuleback to summary
public int getReferentialActionUpdateRule()

Implements org.apache.derby.iapi.sql.dictionary.ConsInfo.getReferentialActionUpdateRule.

Get the referential Action for an Update.

Returns:int

referential Action for update

getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

Returns:int

the formatID of this class

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

Parameters
in:ObjectInput

read this.

Exceptions
IOException:
thrown on error
ClassNotFoundException:
thrown on error
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Write this object out

Parameters
out:ObjectOutput

write bytes here

Exceptions
IOException:
thrown on error