Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.javatools.db
Class ColumnConstraint

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractChildDBObject
          extended by oracle.javatools.db.Constraint
              extended by oracle.javatools.db.ColumnConstraint
All Implemented Interfaces:
ChildDBObject, DBObject, Copyable, DynamicPropertySet
Direct Known Subclasses:
FKConstraint, UniqueConstraint

public abstract class ColumnConstraint
extends Constraint

Abstract model of a Constraint that constrains Columns in the database. Provides the bean properties for getting and setting the IDs of the Columns constrained in the parent Relation.


Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
 
Fields inherited from class oracle.javatools.db.Constraint
TYPE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Method Summary
 void addColumn(Column col)
          Adds a constrained column.
protected  void copyToImpl(ColumnConstraint copy, Relation copyParent, IDPolicy idPolicy)
           
protected  boolean equalsImpl(ColumnConstraint target)
           
 DBObjectID[] getColumnIDs()
          Gets the IDs of the columns referenced by this Constraint.
 Column[] getColumns()
          Retrieves the constrained columns.
protected  void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
          Used by the final getReferenceID() implementation.
static boolean isConstrained(Column col, java.lang.String... constraintTypes)
          Tests whether the given Column appears in any ColumnConstraint on its owning table of given constraint types.
 boolean removeColumn(Column col)
          Removes a column from the list of constrained columns.
 boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
          Override in subclasses to replace reference IDs as appropriate.
 void setColumnIDs(DBObjectID[] ids)
          Sets the IDs of the columns referenced by this Constraint.
 void setColumns(Column[] columns)
          Sets the constrained columns.
 
Methods inherited from class oracle.javatools.db.Constraint
copyToImpl, equalsImpl, getConstraints, getConstraintType, getRelation, getType, isEnabled, setEnabled, setRelation
 
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
copyToImpl, findParent, getParent, setParent
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, copyToImpl, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getProperty, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, setID, setName, setProperties, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.db.DBObject
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, setID, setName
 
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty
 

Method Detail

copyToImpl

protected void copyToImpl(ColumnConstraint copy,
                          Relation copyParent,
                          IDPolicy idPolicy)

equalsImpl

protected boolean equalsImpl(ColumnConstraint target)

getColumns

public Column[] getColumns()
                    throws java.lang.IllegalStateException
Retrieves the constrained columns.

Returns:
the array containing the list of columns being constrained
Throws:
java.lang.IllegalStateException - if the constraint is an orphan, or a column cannot be found in the contraint's owning relation.

setColumns

public void setColumns(Column[] columns)
Sets the constrained columns.

Parameters:
columns - the array containing the list of columns being constrained

addColumn

public void addColumn(Column col)
Adds a constrained column. The column must have a valid ID for this operation to succeed.

Parameters:
col - the Column to add to the list of constrained columns
Throws:
java.lang.IllegalStateException - if the constraint is an orphan, or the column cannot be found in the contraint's owning relation.

removeColumn

public boolean removeColumn(Column col)
Removes a column from the list of constrained columns. The column must have a valid ID for this operation to succeed.

Parameters:
col - the Column to remove to the list of constrained columns

getColumnIDs

public DBObjectID[] getColumnIDs()
Gets the IDs of the columns referenced by this Constraint.


setColumnIDs

public void setColumnIDs(DBObjectID[] ids)
Sets the IDs of the columns referenced by this Constraint.


getReferenceIDsImpl

protected void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
Description copied from class: AbstractDBObject
Used by the final getReferenceID() implementation. The list should not contain null values, or be null. Subclasses should start with super.getReferenceIDsImpl() and then add to the passed list as appopriate.

Overrides:
getReferenceIDsImpl in class AbstractDBObject
Parameters:
refs - the collection of ids this object references

replaceReferenceIDs

public boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
Description copied from class: AbstractDBObject
Override in subclasses to replace reference IDs as appropriate. Always call super in the overridden implementation to make sure the default implementation (which checks the property map) is called.

Specified by:
replaceReferenceIDs in interface DBObject
Overrides:
replaceReferenceIDs in class AbstractDBObject
Parameters:
idMap - key = old DBObjectID, value = new DBObjectID
Returns:
true if any ids were replaced.

isConstrained

public static boolean isConstrained(Column col,
                                    java.lang.String... constraintTypes)
Tests whether the given Column appears in any ColumnConstraint on its owning table of given constraint types.

Parameters:
col - the column to tests (must be parented by a table)
constraintTypes - the types of ColumnConstraint to search for.
Returns:
true if the column appears in any of the matching ColumnConstraints on the table.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.