public class TableMetaData extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Collection<ColumnMetaData> |
columns |
protected String |
comment |
protected Map<String,ForeignKeyMetaData> |
foreignKeys |
protected Map<String,IndexMetaData> |
indexes |
protected ModelMetaData |
modelMetaData |
protected String |
modelTableName |
protected String |
schemaName |
protected String |
tableName |
| Constructor and Description |
|---|
TableMetaData(ModelMetaData modelMetaData,
String modelTableName)
Creates a table meta instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
ColumnMetaData |
getColumnByName(String columnName)
Gets a column by its column name.
|
Collection<ColumnMetaData> |
getColumns()
Gets the meta data for columns.
|
String |
getComment()
Gets the comment.
|
Collection<ForeignKeyMetaData> |
getForeignKeys()
Gets the foreign keys.
|
String |
getFullTableName()
Gets the database table name with optional schemaname prepended.
Always in lowercase. |
Collection<IndexMetaData> |
getIndexes()
Gets the meta data for indexes.
|
ModelMetaData |
getModelMetaData()
Gets the model this table belongs to.
|
String |
getModelTableName()
Gets the table name used in the model.
|
String |
getSchemaName()
Gets the database schema name.
Always in lowercase. |
String |
getTableName()
Gets the database table name.
Always in lowercase. |
int |
hashCode() |
void |
setupTableFromMetaData(DatabaseMetaData metaData,
String schemaPattern,
String tablePattern)
Sets up the column from the database meta data result.
|
String |
toString() |
void |
validate()
Validates and postprocesses the table data.
|
protected final ModelMetaData modelMetaData
protected final String modelTableName
protected String schemaName
protected String tableName
protected String comment
protected final Collection<ColumnMetaData> columns
protected final Map<String,IndexMetaData> indexes
protected final Map<String,ForeignKeyMetaData> foreignKeys
public TableMetaData(ModelMetaData modelMetaData, String modelTableName)
modelMetaData - the model this table belongs tomodelTableName - the tablename used in the modelpublic void setupTableFromMetaData(DatabaseMetaData metaData, String schemaPattern, String tablePattern) throws SQLException
metaData - the database metadataschemaPattern - the schema (null if none, "" if without schema)tablePattern - the table patternSQLException - the processing failedBackendException - if logical meta data processing errorpublic ModelMetaData getModelMetaData()
public String getModelTableName()
public String getSchemaName()
public String getTableName()
public String getFullTableName()
public String getComment()
public Collection<ColumnMetaData> getColumns()
public ColumnMetaData getColumnByName(String columnName)
columnName - the column namepublic Collection<IndexMetaData> getIndexes()
public Collection<ForeignKeyMetaData> getForeignKeys()
public void validate()
Copyright © 2016 Krake Softwaretechnik. All rights reserved.