|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.converters.databaseschema.toxml.TableMetaDataImpl
An implementation of the TableMetaData
interface which extract and stores the information from JDBC java.sql.ResultSet
objects.
TableMetaData
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE Copyright statement |
static java.lang.String |
JDBC_COL_DATA_TYPE |
static java.lang.String |
JDBC_COL_DEC_DIGITS |
static java.lang.String |
JDBC_COL_NAME Column names in JDBC meta data |
static java.lang.String |
JDBC_COL_POSITION |
static java.lang.String |
JDBC_COL_SIZE |
static java.lang.String |
JDBC_COL_TYPE_NAME |
static java.lang.String |
JDBC_FK_CATALOG |
static java.lang.String |
JDBC_FK_COL |
static java.lang.String |
JDBC_FK_SCHEMA |
static java.lang.String |
JDBC_FK_TABLE |
static java.lang.String |
JDBC_PK_COL |
static java.lang.String |
JDBC_PK_TABLE |
private java.lang.String |
mCatalog Catalog name |
private ColumnMetaData[] |
mColumns Column meta data |
private java.util.Set |
mExportedKeys Exported keys meta data |
private java.util.Set |
mImportedKeys Imported keys meta data |
private java.lang.String |
mName Table name |
private java.util.Set |
mPrimaryKeys Primary key names |
private java.lang.String |
mSchema Schema name |
Constructor Summary | |
TableMetaDataImpl(java.lang.String catalog, java.lang.String schema, java.lang.String name) Constructs a new table object with the given name, schema name and catalog name. |
Method Summary | |
java.lang.String |
getCatalogName() Returns the catalog name of this table. |
ColumnMetaData |
getColumn(int column) Returns the type information of the column at the specified index. |
int |
getColumnCount() Returns the number of columns in this table. |
KeyMetaData[] |
getExportedKeys() Returns the exported keys of this table. |
KeyMetaData[] |
getImportedKeys() Returns the imported keys of this table. |
java.lang.String |
getName() Returns the name of this table. |
java.lang.String[] |
getPrimaryKeys() Returns a set of columns which form the (composite) primary key of this table. |
java.lang.String |
getSchemaName() Returns the schema name of this table. |
void |
setColumns(java.sql.ResultSet columns) Extracts information from the given ResultSet and populates the column metadata. |
void |
setExportedKeys(java.sql.ResultSet exportedKeys) Extract information for exported keys from a ResultSet. |
void |
setImportedKeys(java.sql.ResultSet importedKeys) Extract information for imported keys from a ResultSet . |
private void |
setKeys(java.sql.ResultSet keys, java.util.Set keySet) Extract information for keys from a ResultSet and store them in the given set. |
void |
setPrimaryKeys(java.sql.ResultSet primaryKeys) Extract information for primary keys in this table from a ResultSet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private java.lang.String mName
private java.lang.String mSchema
private java.lang.String mCatalog
private ColumnMetaData[] mColumns
private java.util.Set mPrimaryKeys
private java.util.Set mImportedKeys
private java.util.Set mExportedKeys
public static final java.lang.String JDBC_COL_NAME
public static final java.lang.String JDBC_COL_POSITION
public static final java.lang.String JDBC_COL_DATA_TYPE
public static final java.lang.String JDBC_COL_TYPE_NAME
public static final java.lang.String JDBC_COL_SIZE
public static final java.lang.String JDBC_COL_DEC_DIGITS
public static final java.lang.String JDBC_FK_TABLE
public static final java.lang.String JDBC_FK_SCHEMA
public static final java.lang.String JDBC_FK_CATALOG
public static final java.lang.String JDBC_FK_COL
public static final java.lang.String JDBC_PK_TABLE
public static final java.lang.String JDBC_PK_COL
Constructor Detail |
public TableMetaDataImpl(java.lang.String catalog, java.lang.String schema, java.lang.String name)
catalog
- Catalog name where this table is stored.schema
- Schema name where this table stored.name
- Table name.Method Detail |
public void setPrimaryKeys(java.sql.ResultSet primaryKeys) throws ResultSetTableMetaDataException
primaryKeys
- ResultSet containg primary keys metadata.ResultSetTableMetaDataException
- if there is a problem accessing information from the ResultSet.public void setImportedKeys(java.sql.ResultSet importedKeys) throws ResultSetTableMetaDataException
ResultSet
.
importedKeys
- ResultSet containing imported keys.ResultSetTableMetaDataException
- if there is a problem accessing information from the ResultSet.public void setExportedKeys(java.sql.ResultSet exportedKeys) throws ResultSetTableMetaDataException
exportedKeys
- ResultSet containing exported keys.ResultSetTableMetaDataException
- if there is a problem accessing information from the ResultSet.private void setKeys(java.sql.ResultSet keys, java.util.Set keySet) throws ResultSetTableMetaDataException
keys
- ResultSet containing keys.keySet
- Set into which keys are to be inserted.ResultSetTableMetaDataException
- if there is a problem accessing key information from the ResultSet.public void setColumns(java.sql.ResultSet columns) throws ResultSetTableMetaDataException
columns
- ResultSet containing column metadata.ResultSetTableMetaDataException
- if there is a problem accessing information from the ResultSet.public java.lang.String getName()
TableMetaData
getName
in interface TableMetaData
public java.lang.String getSchemaName()
TableMetaData
getSchemaName
in interface TableMetaData
public java.lang.String getCatalogName()
TableMetaData
getCatalogName
in interface TableMetaData
public ColumnMetaData getColumn(int column)
TableMetaData
getColumn
in interface TableMetaData
column
- The column index.public int getColumnCount()
TableMetaData
getColumnCount
in interface TableMetaData
public java.lang.String[] getPrimaryKeys()
TableMetaData
getPrimaryKeys
in interface TableMetaData
public KeyMetaData[] getImportedKeys()
TableMetaData
getImportedKeys
in interface TableMetaData
public KeyMetaData[] getExportedKeys()
TableMetaData
getExportedKeys
in interface TableMetaData
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |