com.ibm.dse.tools.workbench.base
Class Relationship

java.lang.Object
  |
  +--com.ibm.dse.tools.workbench.base.Relationship

public class Relationship
extends java.lang.Object

This class implements a relationship 1 : { private static final java.lang.String COPYRIGHT = "Licensed Materials - Property of IBM "+ "5648-D89 "+ "(C) Copyright IBM Corp. 2000 All Rights Reserved. "+ "US Government Users Restricted Rights - Use, duplication or disclosure "+ "restricted by GSA ADP Schedule Contract with IBM Corp "; 1 | n } from a table to another


Field Summary
protected  int[] columnsFrom
          The list of columns for the first table
protected  int[] columnsTo
          The list of columns for the second table
protected  boolean propagate
          Indicator to control the cascading in delete and copy
protected  Table tableFrom
          The first table
protected  Table tableTo
          The second table
 
Constructor Summary
Relationship(Table tableFrom, Table tableTo, int[] columnsFrom, int[] columnsTo)
          This constructor creates a Relationship object.
 
Method Summary
 int[] getColumnsFrom()
          Returns the list of column identifiers for the first table
 int[] getColumnsTo()
          Returns the list of column identifiers for the second table
 Table getTableFrom()
          Returns the table that has the foreign key
 Table getTableTo()
          Returns the table referred by the foreign key
 boolean mustPropagate()
          Returns the propagation indicator
 void setPropagate(boolean prop)
          Sets the propagation indicator
 java.lang.String toString()
          This method returns a String representation of the Relationship object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tableFrom

protected Table tableFrom
The first table

columnsFrom

protected int[] columnsFrom
The list of columns for the first table

tableTo

protected Table tableTo
The second table

columnsTo

protected int[] columnsTo
The list of columns for the second table

propagate

protected boolean propagate
Indicator to control the cascading in delete and copy
Constructor Detail

Relationship

public Relationship(Table tableFrom,
                    Table tableTo,
                    int[] columnsFrom,
                    int[] columnsTo)
             throws WBInvalidArgumentException
This constructor creates a Relationship object.
Parameters:
tableFrom - com.ibm.dse.tools.workbench.base.Table The table that has the foreign key.
tableTo - com.ibm.dse.tools.workbench.base.Table The table referred by the foreign key.
columnsFrom - int[] The list of columns for the first table.
columnsTo - int[] The list of columns for the second table.
Throws:
WBInvalidArgumentException - The number of columns from and columns to must be equal.
Method Detail

getColumnsFrom

public int[] getColumnsFrom()
Returns the list of column identifiers for the first table
Returns:
int[]

getColumnsTo

public int[] getColumnsTo()
Returns the list of column identifiers for the second table
Returns:
int[]

getTableFrom

public Table getTableFrom()
Returns the table that has the foreign key
Returns:
com.ibm.dse.tools.workbench.Table

getTableTo

public Table getTableTo()
Returns the table referred by the foreign key
Returns:
com.ibm.dse.tools.workbench.Table

mustPropagate

public boolean mustPropagate()
Returns the propagation indicator
Returns:
boolean

setPropagate

public void setPropagate(boolean prop)
Sets the propagation indicator
Parameters:
prop - boolean

toString

public java.lang.String toString()
This method returns a String representation of the Relationship object
Overrides:
toString in class java.lang.Object
Returns:
java.lang.String