public class TableMetadata extends Object
Modifier and Type | Field and Description |
---|---|
static String |
TYPE_TABLE
String representation of type TABLE
|
static String |
TYPE_VIEW
String representation of type VIEW
|
Constructor and Description |
---|
TableMetadata(ResultSet rs,
DatabaseMetaData meta) |
TableMetadata(ResultSet rs,
DatabaseMetaData meta,
boolean loadAllMetadata)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
String |
getCatalog()
Returns the catalog name.
|
ColumnMetadata |
getColumnMetadata(String columnName)
Returns the column metadata for the given column name.
|
List<ColumnMetadata> |
getColumns()
Returns a collection of table columns.
|
Collection<ForeignKeyMetadata> |
getForeignKeyMetadata()
Returns a collection of all foreign key metadata.
|
ForeignKeyMetadata |
getForeignKeyMetadata(String keyName)
Returns the foreign key metadata for the given key name.
|
Collection<IndexMetadata> |
getIndexMetadata()
Returns metadata of indexes.
|
IndexMetadata |
getIndexMetadata(String indexName)
Returns the index metadata for the given index name.
|
String |
getName()
Returns the table name.
|
PrimaryKeyMetadata |
getPrimaryKeyMetadata()
Returns the primary key metadata.
|
String |
getSchema()
Returns the schema name.
|
static String[] |
getTypes()
Types which should be considered when reading the db schema (TABLE, VIEW)
|
void |
initForeignKeys(DatabaseMetaData meta) |
void |
initIndexes(DatabaseMetaData meta)
loads all indexes definitions for this table from database
|
void |
initPrimaryKeys(DatabaseMetaData meta)
loads primary key definition for this table from database
|
String |
toString() |
public static final String TYPE_TABLE
public static final String TYPE_VIEW
public TableMetadata(ResultSet rs, DatabaseMetaData meta) throws SQLException
rs
- meta
- SQLException
public TableMetadata(ResultSet rs, DatabaseMetaData meta, boolean loadAllMetadata) throws SQLException
rs
- meta
- loadAllMetadata
- if true, also primary key, foreign keys and indexes information will be loaded automaticallySQLException
public static String[] getTypes()
public String getName()
public String getCatalog()
public String getSchema()
public List<ColumnMetadata> getColumns()
public ColumnMetadata getColumnMetadata(String columnName)
columnName
- public ForeignKeyMetadata getForeignKeyMetadata(String keyName)
keyName
- public Collection<ForeignKeyMetadata> getForeignKeyMetadata()
public PrimaryKeyMetadata getPrimaryKeyMetadata()
public Collection<IndexMetadata> getIndexMetadata()
public IndexMetadata getIndexMetadata(String indexName)
indexName
- public void initForeignKeys(DatabaseMetaData meta) throws SQLException
meta
- SQLException
public void initPrimaryKeys(DatabaseMetaData meta) throws SQLException
meta
- SQLException
public void initIndexes(DatabaseMetaData meta) throws SQLException
meta
- SQLException
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.