public class TableAlias extends Object implements Table
Table.IndexType
Modifier and Type | Field and Description |
---|---|
protected String |
alias
The name (alias) used to refer to this table.
|
protected Dialect |
dialect |
protected Table |
table
The table this is an alias of.
|
Constructor and Description |
---|
TableAlias(Table table,
String alias)
Creates a table as an alias for another one.
|
Modifier and Type | Method and Description |
---|---|
Column |
addColumn(String name,
ColumnType type,
String key,
Model model)
Adds a
Column to the table. |
void |
addIndex(String... columnNames)
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.
|
String |
getAddColumnSql(Column column)
Computes the SQL statement to alter a table and add a column to it.
|
Column |
getColumn(String name) |
Collection<Column> |
getColumns() |
String |
getCreateSql()
Computes the SQL statement to create the table.
|
Dialect |
getDialect() |
String |
getDropSql()
Computes the SQL statement to drop the table.
|
String |
getKey() |
String |
getPhysicalName() |
List<String> |
getPostAddSqls(Column column,
Model model)
Computes the SQL statements to finish adding a column, usually some ALTER TABLE statements to add constraints or
indexes.
|
List<String> |
getPostCreateSqls(Model model)
Computes the SQL statements to finish creating the table, usually some ALTER TABLE statements to add constraints
or indexes.
|
Column |
getPrimaryColumn() |
String |
getQuotedName() |
String |
getQuotedSuffixedName(String suffix) |
Table |
getRealTable() |
boolean |
hasFulltextIndex()
Checks if the table has some fulltext indexes.
|
boolean |
isAlias() |
String |
toString() |
public TableAlias(Table table, String alias)
public Table getRealTable()
getRealTable
in interface Table
public Dialect getDialect()
getDialect
in interface Table
public String getPhysicalName()
getPhysicalName
in interface Table
public String getQuotedName()
getQuotedName
in interface Table
public String getQuotedSuffixedName(String suffix)
getQuotedSuffixedName
in interface Table
public Column getPrimaryColumn()
getPrimaryColumn
in interface Table
public Collection<Column> getColumns()
getColumns
in interface Table
public Column addColumn(String name, ColumnType type, String key, Model model)
Table
Column
to the table.public void addIndex(String... columnNames)
Table
public void addIndex(String indexName, Table.IndexType indexType, String... columnNames)
Table
public boolean hasFulltextIndex()
Table
hasFulltextIndex
in interface Table
true
if the table has some fulltext indexespublic String getCreateSql()
Table
getCreateSql
in interface Table
public String getAddColumnSql(Column column)
Table
getAddColumnSql
in interface Table
column
- the column to addpublic List<String> getPostCreateSqls(Model model)
Table
getPostCreateSqls
in interface Table
public List<String> getPostAddSqls(Column column, Model model)
Table
getPostAddSqls
in interface Table
public String getDropSql()
Table
TODO drop constraints and indexes
getDropSql
in interface Table
Copyright © 2016 Nuxeo SA. All rights reserved.