org.apache.derby.impl.sql.execute
Class ConstraintInfo

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.ConstraintInfo
All Implemented Interfaces:
ConsInfo, java.io.Externalizable, Formatable, java.io.Serializable, TypedFormat

public class ConstraintInfo
extends java.lang.Object
implements ConsInfo

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

Author:
jamie
See Also:
Serialized Form

Field Summary
private  java.lang.String[] columnNames
           
private  int raDeleteRule
           
private  int raUpdateRule
           
private  java.lang.String tableName
          This class implements Formatable.
private  UUID tableSchemaId
           
private  SchemaDescriptor tableSd
           
 
Constructor Summary
ConstraintInfo()
          Niladic constructor for Formattable
ConstraintInfo(java.lang.String tableName, SchemaDescriptor tableSd, java.lang.String[] columnNames, int raDeleteRule, int raUpdateRule)
          Consructor
 
Method Summary
 java.lang.String[] getReferencedColumnNames()
          This ConsInfo describes columns in a referenced table.
 TableDescriptor getReferencedTableDescriptor(DataDictionary dd)
          This ConsInfo describes columns in a referenced table.
 java.lang.String getReferencedTableName()
          Get the name of the table that these column live in.
 SchemaDescriptor getReferencedTableSchemaDescriptor(DataDictionary dd)
          This ConsInfo describes columns in a referenced table.
 int getReferentialActionDeleteRule()
          Get the referential Action for a Delete.
 int getReferentialActionUpdateRule()
          Get the referential Action for an Update.
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 void readExternal(java.io.ObjectInput in)
          Read this object from a stream of stored objects.
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
          Write this object out
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tableName

private java.lang.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.


tableSd

private SchemaDescriptor tableSd

tableSchemaId

private UUID tableSchemaId

columnNames

private java.lang.String[] columnNames

raDeleteRule

private int raDeleteRule

raUpdateRule

private int raUpdateRule
Constructor Detail

ConstraintInfo

public ConstraintInfo()
Niladic constructor for Formattable


ConstraintInfo

public ConstraintInfo(java.lang.String tableName,
                      SchemaDescriptor tableSd,
                      java.lang.String[] columnNames,
                      int raDeleteRule,
                      int raUpdateRule)
Consructor

Method Detail

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Write this object out

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - write bytes here
Throws:
java.io.IOException - thrown on error

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Read this object from a stream of stored objects.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - read this.
Throws:
java.io.IOException - thrown on error
java.lang.ClassNotFoundException - thrown on error

getTypeFormatId

public int getTypeFormatId()
Get the formatID which corresponds to this class.

Specified by:
getTypeFormatId in interface TypedFormat
Returns:
the formatID of this class

toString

public java.lang.String toString()

getReferencedTableSchemaDescriptor

public SchemaDescriptor getReferencedTableSchemaDescriptor(DataDictionary dd)
                                                    throws StandardException
Description copied from interface: ConsInfo
This ConsInfo describes columns in a referenced table. What is the schema that the referenced table lives in?

Specified by:
getReferencedTableSchemaDescriptor in interface ConsInfo
Parameters:
dd - data dictionary to search for schema
Returns:
schema that referenced table lives in
Throws:
StandardException - thrown on oops

getReferencedTableDescriptor

public TableDescriptor getReferencedTableDescriptor(DataDictionary dd)
                                             throws StandardException
Description copied from interface: ConsInfo
This ConsInfo describes columns in a referenced table. What is that table?

Specified by:
getReferencedTableDescriptor in interface ConsInfo
Parameters:
dd - data dictionary to search for table
Returns:
referenced table
Throws:
StandardException - thrown on oops

getReferencedColumnNames

public java.lang.String[] getReferencedColumnNames()
This ConsInfo describes columns in a referenced table. What are their names?

Specified by:
getReferencedColumnNames in interface ConsInfo
Returns:
array of referenced column names

getReferencedTableName

public java.lang.String getReferencedTableName()
Get the name of the table that these column live in.

Specified by:
getReferencedTableName in interface ConsInfo
Returns:
referenced table name

getReferentialActionUpdateRule

public int getReferentialActionUpdateRule()
Get the referential Action for an Update.

Specified by:
getReferentialActionUpdateRule in interface ConsInfo
Returns:
referential Action for update

getReferentialActionDeleteRule

public int getReferentialActionDeleteRule()
Get the referential Action for a Delete.

Specified by:
getReferentialActionDeleteRule in interface ConsInfo
Returns:
referential Action Delete rule


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.