Extension SDK 10.1.2


oracle.jdeveloper.cm.ds.db
Class Relation

java.lang.Object
  extended byoracle.jdeveloper.cm.ds.db.AbstractDBObject
      extended byoracle.jdeveloper.cm.ds.db.AbstractSchemaObject
          extended byoracle.jdeveloper.cm.ds.db.Relation

All Implemented Interfaces:
Copyable, DBObject, SchemaObject, Subject
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

Field Summary

Fields inherited from interface oracle.jdeveloper.cm.ds.db.DBObject
COMMENT

Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED

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 addConstraint(Constraint constraint)
Adds a Constraint to this relation.
protected void copyToImpl(Relation copy)
protected boolean equalsImpl(Relation target)
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.
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.jdeveloper.cm.ds.db.AbstractSchemaObject
copyToImpl, equalsImpl, getSchema, setSchema

Methods inherited from class oracle.jdeveloper.cm.ds.db.AbstractDBObject
attach, compareToImpl, copyToImpl, detach, equals, equalsImpl, getID, getName, getProperties, getProperty, hashCode, notifyObservers, setID, setName, setProperties, setProperty, toString

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Methods inherited from interface oracle.jdeveloper.cm.ds.db.DBObject
copyTo, getID, getName, getProperties, getProperty, getType, setID, setName, setProperties, setProperty

Methods inherited from interface oracle.ide.addin.Subject
attach, detach, notifyObservers

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

copyToImpl

protected void copyToImpl(Relation copy)

equalsImpl

protected boolean equalsImpl(Relation target)

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

getColumn

public Column getColumn(java.lang.String name)
Retrieves one column by name.
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

Extension SDK


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