Skip navigation links

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

E52944-01


oracle.javatools.db
Class Relation

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractBuildableObject
          extended by oracle.javatools.db.AbstractSystemObject
              extended by oracle.javatools.db.AbstractSchemaObject
                  extended by oracle.javatools.db.Relation

All Implemented Interfaces:
DBObject, SchemaObject, SystemObject, Copyable, DynamicPropertySet
Direct Known Subclasses:
Table, View

public abstract class Relation
extends AbstractSchemaObject

A Relation represents the basic entity of a relational database. Examples of relations include tables and views.

A Relation contains a list of Columns and a list of Constraints on the values for the columns in the Relation. Column and Constraint instances are managed by Relation instances; making a copy of a Relation imples making a copy of each Column and Constraint contained within the Relation.

Since:
9.0.5

Nested Class Summary

 

Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport

 

Field Summary

 

Fields inherited from class oracle.javatools.db.AbstractSystemObject
m_listeners

 

Fields inherited from interface oracle.javatools.db.DBObject
COMMENT

 

Constructor Summary
protected Relation()
          Constructs a new Relation.
protected Relation(java.lang.String name, Schema schema)
          Constructs a new Relation with the specified name in the specified schema.

 

Method Summary
 void addColumn(Column col)
          Adds one column to this relation.
 void addColumn(int index, Column col)
          Adds one column to this relation at the given index.
 void addConstraint(Constraint constraint)
          Adds a Constraint to this relation.
 Column getColumn(java.lang.String name)
          Retrieves one column by name.
 Column[] getColumns()
          Retrieves the list of columns contained in this relation.
 Constraint getConstraint(java.lang.String name)
          Retrieves a Constraint by name.
 Constraint[] getConstraints()
          Retrieves the list of constraints on this relation.
protected  void getOwnedObjectsImpl(java.util.Collection<DBObject> c, java.lang.String... types)
          Implementation first checks that the object has been built - then returns the collection from suprt.getOwnedObjectsImpl().
 void removeColumn(Column col)
          Removes a column from this relation.
 void removeConstraint(Constraint constraint)
          Removes a Constraint from this relation.
 void setColumns(Column[] newCols)
          Sets the entire list of columns, replacing any that have previously been added.
 void setConstraints(Constraint[] constraints)
          Sets the list of constraints on this relation.

 

Methods inherited from class oracle.javatools.db.AbstractSchemaObject
addObjectListener, copyToImpl, equalsImpl, getProperty, getSchema, removeObjectListener, setProperty, setSchema

 

Methods inherited from class oracle.javatools.db.AbstractSystemObject
addObjectListener, fireObjectUpdated, getParent, removeObjectListener

 

Methods inherited from class oracle.javatools.db.AbstractBuildableObject
checkInit, checkInit, getProperties, getReferenceIDsImpl, needsInitialization

 

Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getProperty, getReferenceIDs, 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.SystemObject
addObjectListener, fireObjectUpdated, removeObjectListener

 

Methods inherited from interface oracle.javatools.db.DBObject
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getParent, getReferenceIDs, getType, replaceReferenceIDs, setID, setName

 

Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, setProperties

 

Constructor Detail

Relation

protected Relation()
Constructs a new Relation.

Relation

protected Relation(java.lang.String name,
                   Schema schema)
Constructs a new Relation with the specified name in the specified schema.
Parameters:
name - a string containing the name of the new relation
schema - the schema containing the new relation

Method Detail

setColumns

public void setColumns(Column[] newCols)
Sets the entire list of columns, replacing any that have previously been added.
Parameters:
newCols - an array containing the new list of columns

getColumns

public Column[] getColumns()
Retrieves the list of columns contained in this relation.
Returns:
an array containing the list of columns

addColumn

public void addColumn(Column col)
Adds one column to this relation.
Parameters:
col - the new column to add

addColumn

public void addColumn(int index,
                      Column col)
Adds one column to this relation at the given index. Shift the Column at that position (and any subesquent Columns) down one place.
Parameters:
index - the index to add the new column at
col - the new column to add

getColumn

public Column getColumn(java.lang.String name)
Retrieves one column by name.
Parameters:
a - string containing the desired column
Returns:
The column requested or null

removeColumn

public void removeColumn(Column col)
Removes a column from this relation.
Parameters:
col - the column to remove

getConstraints

public Constraint[] getConstraints()
Retrieves the list of constraints on this relation.
Returns:
an array containing the list of constraints

setConstraints

public void setConstraints(Constraint[] constraints)
Sets the list of constraints on this relation.
Parameters:
constraints - an array containing the list of constraints

getConstraint

public Constraint getConstraint(java.lang.String name)
Retrieves a Constraint by name.
Parameters:
name - a string containing the name of the constraint
Returns:
the Constraint of the specified name, or null if no constraint of that name exists in this relation

addConstraint

public void addConstraint(Constraint constraint)
Adds a Constraint to this relation.
Parameters:
constraint - the constraint to add

removeConstraint

public void removeConstraint(Constraint constraint)
Removes a Constraint from this relation.
Parameters:
constraint - the constraint to remove

getOwnedObjectsImpl

protected void getOwnedObjectsImpl(java.util.Collection<DBObject> c,
                                   java.lang.String... types)
Description copied from class: AbstractBuildableObject
Implementation first checks that the object has been built - then returns the collection from suprt.getOwnedObjectsImpl(). All overrides must call this first to ensure the object has been built.
Overrides:
getOwnedObjectsImpl in class AbstractBuildableObject
Parameters:
c - a Collection of the apppropriate children.
types - a vararg of the type(s) to search for
See Also:
AbstractDBObject.includesType(java.lang.String, java.lang.String...)

Skip navigation links

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

E52944-01


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