2004.04.29


com.jdc.rdb
Class Table

java.lang.Object
  |
  +--com.jdc.lang.Object
        |
        +--com.jdc.lang.SerializableObject
              |
              +--com.jdc.rdb.Table
All Implemented Interfaces:
Serializable, Table
Direct Known Subclasses:
Country

public abstract class Table
extends SerializableObject
implements Table

A default implementation of Table. All application database table classes should subclass this database Table class or one of its subclasses.

A database Table is defined by its attributes. The following are attributes of database tables:

To define a database table, extend this class and invoke one of the constructors provided.

Note: This class is immutable.

Version:
1.5
Author:
Jay Damon
See Also:
com.jdc.rdb.tbl.Column, Serialized Form

Field Summary
 
Fields inherited from class com.jdc.lang.Object
string
 
Constructor Summary
protected Table(String name, String alias, Column[] columns, Column[] primaryKeys)
          Constructs a new database table Table object for the specified database table name, alias, column definitions, and primary key columns.
protected Table(String name, String alias, Column[] columns, Column[][] keys)
          Constructs a new database table Table object for the specified database table name, alias, column definitions, and primary and secondary key columns.
 
Method Summary
 boolean equals(Object object)
          Compares this Table object to the specified object.
protected  void finalize()
          cleans up system resources.
 String getAlias()
          Returns the database table alias.
 Column getColumn(String name)
          Returns the database table Column definition for a specified table column name (or table column alias).
 Column[] getColumns()
          Returns the database table Column definitions.
 Column[][] getKeyColumns()
          Returns the database table key Column definitions.
 String getName()
          Returns the database table name.
abstract  Schema getSchema()
          Returns the database table Schema.
 int hashCode()
          Returns a hash code value for this Table object.
 String toString()
          Returns a String representing this Table object.
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Table

protected Table(String name,
                String alias,
                Column[] columns,
                Column[] primaryKeys)
Constructs a new database table Table object for the specified database table name, alias, column definitions, and primary key columns.


Table

protected Table(String name,
                String alias,
                Column[] columns,
                Column[][] keys)
Constructs a new database table Table object for the specified database table name, alias, column definitions, and primary and secondary key columns.

Method Detail

equals

public boolean equals(Object object)
Compares this Table object to the specified object. Returns true if the specified object is equivalent to this table object.

Overrides:
equals in class Object
Returns:
True if a specified object is equal to this table object.
False if the specified object is not equal to this table object.

See Also:
hashCode()

finalize

protected void finalize()
cleans up system resources.

When garbage collection determines that there are no more references to this table object, it invokes this method to clean up system resources.

Overrides:
finalize in class Object

getAlias

public String getAlias()
Returns the database table alias. If an alias is not specified, this method generates a table alias from the database table name.

Specified by:
getAlias in interface Table
Returns:
The database table alias.

getColumn

public Column getColumn(String name)
Description copied from interface: Table
Returns the database table Column definition for a specified table column name (or table column alias).

Specified by:
getColumn in interface Table
Returns:
The database table Column definition.

getColumns

public Column[] getColumns()
Description copied from interface: Table
Returns the database table Column definitions.

Specified by:
getColumns in interface Table
Returns:
The database table Column definitions.

getKeyColumns

public Column[][] getKeyColumns()
Description copied from interface: Table
Returns the database table key Column definitions.

Specified by:
getKeyColumns in interface Table
Returns:
The database table key Column definitions.

getName

public String getName()
Description copied from interface: Table
Returns the database table name.

Specified by:
getName in interface Table
Returns:
The database table name.

getSchema

public abstract Schema getSchema()
Description copied from interface: Table
Returns the database table Schema.

Specified by:
getSchema in interface Table
Returns:
The database table Schema.

hashCode

public int hashCode()
Returns a hash code value for this Table object. This method is supported for the benefit of hashtables such as those provided by Hashtable.

Overrides:
hashCode in class Object
Returns:
A hash code value for this table object.

See Also:
equals(java.lang.Object)

toString

public String toString()
Returns a String representing this Table object.

Overrides:
toString in class Object
Returns:
A String representing this Table object.

2004.04.29



Copyright © 2004 J. Damon & Co.; All Rights Reserved WorldWide.