Interface Table
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
TableAlias
,TableImpl
A SQL table.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddColumn
(String name, ColumnType type, String key, Model model) Adds aColumn
to the table.void
Adds an index on one or several columns.void
addIndex
(String indexName, Table.IndexType indexType, String... columnNames) Adds an index of the given name and type on one or several columns.getAddColumnSql
(Column column) Computes the SQL statement to alter a table and add a column to it.Computes the SQL statement to create the table.Computes the SQL statement to drop the table.getKey()
getPostAddSqls
(Column column, Model model) Computes the SQL statements to finish adding a column, usually some ALTER TABLE statements to add constraints or indexes.getPostCreateSqls
(Model model) Computes the SQL statements to finish creating the table, usually some ALTER TABLE statements to add constraints or indexes.getQuotedSuffixedName
(String suffix) boolean
Checks if the table has some fulltext indexes.boolean
isAlias()
-
Method Details
-
isAlias
boolean isAlias() -
getRealTable
Table getRealTable() -
getDialect
Dialect getDialect() -
getKey
String getKey() -
getPhysicalName
String getPhysicalName() -
getQuotedName
String getQuotedName() -
getQuotedSuffixedName
-
getColumn
-
getPrimaryColumn
Column getPrimaryColumn() -
getColumns
Collection<Column> getColumns() -
addColumn
Adds aColumn
to the table. -
addIndex
Adds an index on one or several columns.- Parameters:
columnNames
- the column names
-
addIndex
Adds an index of the given name and type on one or several columns.- Parameters:
indexName
- the index nameindexType
- the index typecolumnNames
- the column names
-
hasFulltextIndex
boolean hasFulltextIndex()Checks if the table has some fulltext indexes.- Returns:
true
if the table has some fulltext indexes
-
getCreateSql
String getCreateSql()Computes the SQL statement to create the table.- Returns:
- the SQL create string.
-
getAddColumnSql
Computes the SQL statement to alter a table and add a column to it.- Parameters:
column
- the column to add- Returns:
- the SQL alter table string
-
getPostCreateSqls
Computes the SQL statements to finish creating the table, usually some ALTER TABLE statements to add constraints or indexes.- Returns:
- the SQL strings
-
getPostAddSqls
Computes the SQL statements to finish adding a column, usually some ALTER TABLE statements to add constraints or indexes.- Returns:
- the SQL strings
-
getDropSql
String getDropSql()Computes the SQL statement to drop the table.TODO drop constraints and indexes
- Returns:
- the SQL drop string.
-