java.lang.Object
org.tentackle.sql.metadata.TableMetaData
Database metadata for a table that is part of the model.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionTableMetaData(ModelMetaData modelMetaData, String modelTableName) Creates a table meta instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetColumnByName(String columnName) Gets a column by its column name.Gets the metadata for columns.Gets the comment.Gets the foreign keys.Gets the database table name with optional schemaname prepended.
Always in lowercase.Gets the metadata for indexes.Gets the model this table belongs to.Gets the table name used in the model.Gets the database schema name.
Always in lowercase.Gets the database table name.
Always in lowercase.inthashCode()voidsetComment(String comment) Sets the comment.voidsetupTableFromMetaData(DatabaseMetaData metaData, String[] schemas, String schemaPattern, String tablePattern) Sets up the column from the database metadata result.toString()voidvalidate()Validates and post-processes the table data.
-
Constructor Details
-
TableMetaData
Creates a table meta instance.- Parameters:
modelMetaData- the model this table belongs tomodelTableName- the tablename used in the model
-
-
Method Details
-
setupTableFromMetaData
public void setupTableFromMetaData(DatabaseMetaData metaData, String[] schemas, String schemaPattern, String tablePattern) throws SQLException Sets up the column from the database metadata result.- Parameters:
metaData- the database metadataschemas- valid schemas to scan, null if allschemaPattern- the schema (null if none, "" if without schema)tablePattern- the table pattern- Throws:
SQLException- the processing failedBackendException- if logical meta data processing error
-
getModelMetaData
Gets the model this table belongs to.- Returns:
- the model
-
getModelTableName
Gets the table name used in the model.- Returns:
- the model's tablename
-
getSchemaName
Gets the database schema name.
Always in lowercase.- Returns:
- the schema, null if none
-
getTableName
Gets the database table name.
Always in lowercase.- Returns:
- the table name (without schema)
-
getFullTableName
Gets the database table name with optional schemaname prepended.
Always in lowercase.- Returns:
- the full table name
-
getComment
Gets the comment.- Returns:
- the comment, null if none
-
setComment
Sets the comment.- Parameters:
comment- the comment, null if none
-
getColumns
Gets the metadata for columns.- Returns:
- the columns
-
getColumnByName
Gets a column by its column name.- Parameters:
columnName- the column name- Returns:
- the column, null if no such column
-
getIndexes
Gets the metadata for indexes.- Returns:
- the indexes
-
getForeignKeys
Gets the foreign keys.- Returns:
- the foreign keys
-
validate
public void validate()Validates and post-processes the table data. -
hashCode
public int hashCode() -
equals
-
toString
-