com.triactive.jdo.store.adapter
Class TableInfo

java.lang.Object
  extended bycom.triactive.jdo.store.adapter.CatalogInfo
      extended bycom.triactive.jdo.store.adapter.TableInfo

public class TableInfo
extends CatalogInfo

Represents the metadata of a specific table. This class is basically a data structure that makes accessing the JDBC table metadata easier. Each of the items returned by DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) is represented by a public field in this class.

Subclasses of TableInfo can be created on a per-DBMS basis to supply missing metadata or correct faulty metadata obtained from that DBMS's JDBC driver(s).

Author:
Mike Martin
See Also:
DatabaseAdapter.newTableInfo(java.sql.ResultSet)

Field Summary
 java.lang.String remarks
          Explanatory comment on the table.
 java.lang.String tableCat
          Table catalog, (may be null).
 java.lang.String tableName
          Table name.
 java.lang.String tableSchem
          Table schema, (may be null).
 java.lang.String tableType
          Table type.
 
Constructor Summary
TableInfo(java.sql.ResultSet rs)
          Constructs a table information object from the current row of the given result set.
TableInfo(java.lang.String tableCat, java.lang.String tableSchem, java.lang.String tableName, java.lang.String tableType, java.lang.String remarks)
          Constructs a table information object from its individual attributes.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some object is "equal to" this one.
 java.lang.String getTableCatalog()
           
 java.lang.String getTableName()
           
 java.lang.String getTableSchema()
           
 int hashCode()
          Returns a hash code value for this object.
 java.lang.String toString()
          Returns the string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

tableCat

public java.lang.String tableCat
Table catalog, (may be null).


tableSchem

public java.lang.String tableSchem
Table schema, (may be null).


tableName

public java.lang.String tableName
Table name.


tableType

public java.lang.String tableType
Table type.


remarks

public java.lang.String remarks
Explanatory comment on the table.

Constructor Detail

TableInfo

public TableInfo(java.sql.ResultSet rs)
          throws java.sql.SQLException
Constructs a table information object from the current row of the given result set. The result set passed must have been obtained from a call to DatabaseMetaData.getTables().

This method only retrieves the values from the current row; the caller is required to advance to the next row with ResultSet.next().

Parameters:
rs - The result set returned from DatabaseMetaData.getTables().
Throws:
java.sql.SQLException - if a column of table information could not be retrieved from the result set.

TableInfo

public TableInfo(java.lang.String tableCat,
                 java.lang.String tableSchem,
                 java.lang.String tableName,
                 java.lang.String tableType,
                 java.lang.String remarks)
Constructs a table information object from its individual attributes.

This can be useful to subclasses and/or custom DatabaseAdapters that need to modify and/or correct the metadata returned by the JDBC driver.

Method Detail

getTableCatalog

public java.lang.String getTableCatalog()
Specified by:
getTableCatalog in class CatalogInfo

getTableSchema

public java.lang.String getTableSchema()
Specified by:
getTableSchema in class CatalogInfo

getTableName

public java.lang.String getTableName()
Specified by:
getTableName in class CatalogInfo

equals

public final boolean equals(java.lang.Object obj)
Indicates whether some object is "equal to" this one. Two TableInfo objects are considered equal if their catalog, schema, and table names are all equal.

Parameters:
obj - the reference object with which to compare
Returns:
true if this object is equal to the obj argument; false otherwise.

hashCode

public final int hashCode()
Returns a hash code value for this object.


toString

public java.lang.String toString()
Returns the string representation of this object.



Copyright 2001-2007 The TJDO Project All Rights Reserved.