Skip navigation links 
 
oracle.javatools.db
Class ColumnConstraint
java.lang.Object
  
oracle.javatools.db.AbstractDBObject
      
oracle.javatools.db.AbstractChildDBObject
          
oracle.javatools.db.Constraint
              
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.
 
 
  
 
 
 
  
 
| Method Summary | 
 void | 
addColumn(Column col) 
          Adds a constrained column. | 
 DBObjectID[] | 
getColumnIDs() 
          Gets the IDs of the columns referenced by this Constraint. | 
 Column[] | 
getColumns() 
          Retrieves the constrained columns. | 
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. | 
 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.AbstractDBObject | 
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, toString | 
 
| Methods inherited from class java.lang.Object | 
clone, 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, replaceReferenceIDs, setID, setName | 
 
 
 
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.
 
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.
 
 
Skip navigation links 
 
Copyright © 1997, 2014, Oracle. All rights reserved.