SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.kodo.impl.jdbc.schema
Class Table

java.lang.Object
  |
  +--com.solarmetric.rd.kodo.impl.jdbc.schema.NameSet
        |
        +--com.solarmetric.rd.kodo.impl.jdbc.schema.Table
All Implemented Interfaces:
java.lang.Comparable, SourceTracker

public class Table
extends NameSet
implements java.lang.Comparable, SourceTracker

Represents a database table.


Method Summary
 com.solarmetric.rd.kodo.impl.jdbc.schema.Column addColumn(java.lang.String name)
          Add a column to the table.
 com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey addForeignKey()
          Add a foreign key to the table.
 com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey addForeignKey(java.lang.String name)
          Add a foreign key to the table.
 com.solarmetric.rd.kodo.impl.jdbc.schema.Index addIndex(java.lang.String name)
          Add an index to the table.
 com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey addPrimaryKey()
          Set the primary key for the table.
 com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey addPrimaryKey(java.lang.String name)
          Set the primary key for the table.
 int compareTo(java.lang.Object other)
           
 com.solarmetric.rd.kodo.impl.jdbc.schema.Column getColumn(java.lang.String name)
          Return the column with the given name, or null if none.
 com.solarmetric.rd.kodo.impl.jdbc.schema.Column[] getColumns()
          Return the table's columns, in alphabetical order.
 com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey getForeignKey(java.lang.String name)
          Return the foreign key with the given name.
 com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey[] getForeignKeys()
          Return all foreign keys for the table.
 java.lang.String getFullName()
          Return the table name, including schema.
 com.solarmetric.rd.kodo.impl.jdbc.schema.Index getIndex(java.lang.String name)
          Return the index with the given name, or null if none.
 com.solarmetric.rd.kodo.impl.jdbc.schema.Index[] getIndexes()
          Return the table's indexes.
 java.lang.String getName()
          Return the name of the table.
 com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey getPrimaryKey()
          Return the primary key for the table, if any.
 com.solarmetric.rd.kodo.impl.jdbc.schema.Schema getSchema()
          Return the schema for the table.
 java.io.File getSourceFile()
          Return the source file the table was parsed from, if any.
 com.solarmetric.rd.kodo.impl.jdbc.schema.Column importColumn(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
          Import a column from another table.
 com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey importForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
          Import a foreign key; column names must match columns of this table.
 com.solarmetric.rd.kodo.impl.jdbc.schema.Index importIndex(com.solarmetric.rd.kodo.impl.jdbc.schema.Index idx)
          Import an index; column names must match columns of this table.
 com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey importPrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey pk)
          Import a primary key; column names must match columns of this table.
 boolean removeColumn(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
          Remove the given column from the table.
 boolean removeForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
          Remove the given foreign key from the table.
 boolean removeIndex(com.solarmetric.rd.kodo.impl.jdbc.schema.Index idx)
          Remove the given index from the table.
 boolean removePrimaryKey()
          Remove the primary key from this table.
 void setSourceFile(java.io.File source)
          Set the source file the table was parsed from, if any.
 java.lang.String toString()
           
 
Methods inherited from class com.solarmetric.rd.kodo.impl.jdbc.schema.NameSet
addName, isNameTaken, removeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSchema

public com.solarmetric.rd.kodo.impl.jdbc.schema.Schema getSchema()
Return the schema for the table.


getName

public java.lang.String getName()
Return the name of the table.


getFullName

public java.lang.String getFullName()
Return the table name, including schema.


getSourceFile

public java.io.File getSourceFile()
Return the source file the table was parsed from, if any.

Specified by:
getSourceFile in interface SourceTracker

setSourceFile

public void setSourceFile(java.io.File source)
Set the source file the table was parsed from, if any.


getColumns

public com.solarmetric.rd.kodo.impl.jdbc.schema.Column[] getColumns()
Return the table's columns, in alphabetical order.


getColumn

public com.solarmetric.rd.kodo.impl.jdbc.schema.Column getColumn(java.lang.String name)
Return the column with the given name, or null if none.


addColumn

public com.solarmetric.rd.kodo.impl.jdbc.schema.Column addColumn(java.lang.String name)
Add a column to the table.


removeColumn

public boolean removeColumn(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
Remove the given column from the table.

Returns:
true if the column was removed, false if not in the table

importColumn

public com.solarmetric.rd.kodo.impl.jdbc.schema.Column importColumn(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
Import a column from another table.


getPrimaryKey

public com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey getPrimaryKey()
Return the primary key for the table, if any.


addPrimaryKey

public com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey addPrimaryKey()
Set the primary key for the table.


addPrimaryKey

public com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey addPrimaryKey(java.lang.String name)
Set the primary key for the table.


removePrimaryKey

public boolean removePrimaryKey()
Remove the primary key from this table.

Returns:
true if there was a pk to remove, false otherwise

importPrimaryKey

public com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey importPrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey pk)
Import a primary key; column names must match columns of this table.


getForeignKey

public com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey getForeignKey(java.lang.String name)
Return the foreign key with the given name. If multiple foreign keys have the name, the first match is returned.


getForeignKeys

public com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey[] getForeignKeys()
Return all foreign keys for the table.


addForeignKey

public com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey addForeignKey()
Add a foreign key to the table.


addForeignKey

public com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey addForeignKey(java.lang.String name)
Add a foreign key to the table. Duplicate key names are not allowed.


removeForeignKey

public boolean removeForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
Remove the given foreign key from the table.

Returns:
true if the key was removed, false if not in the table

importForeignKey

public com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey importForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
Import a foreign key; column names must match columns of this table.


getIndexes

public com.solarmetric.rd.kodo.impl.jdbc.schema.Index[] getIndexes()
Return the table's indexes.


getIndex

public com.solarmetric.rd.kodo.impl.jdbc.schema.Index getIndex(java.lang.String name)
Return the index with the given name, or null if none.


addIndex

public com.solarmetric.rd.kodo.impl.jdbc.schema.Index addIndex(java.lang.String name)
Add an index to the table.


removeIndex

public boolean removeIndex(com.solarmetric.rd.kodo.impl.jdbc.schema.Index idx)
Remove the given index from the table.

Returns:
true if the index was removed, false if not in the table

importIndex

public com.solarmetric.rd.kodo.impl.jdbc.schema.Index importIndex(com.solarmetric.rd.kodo.impl.jdbc.schema.Index idx)
Import an index; column names must match columns of this table.


compareTo

public int compareTo(java.lang.Object other)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.