public class Table extends Object
| Modifier and Type | Method and Description |
|---|---|
Table |
addColumn(Column column)
Add a column definition piece in DDL
|
void |
addSequence(Sequence sequence)
Add a sequence definition DDL
|
void |
addSequence(String name,
String sequenceName,
Integer initialValue,
Integer allocationSize)
Add a sequence definition DDL, note: some dialects do not support sequence
|
void |
addTableGenerator(String name,
String tableName,
String pkColumnName,
String valueColumnName,
String pkColumnValue,
Integer initialValue,
Integer allocationSize)
Add a "create table..." DDL to generate ID, similar like JPA's TableGenerator
|
void |
addTableGenerator(TableGenerator tableGenerator)
Add a "create table..." DDL to generate ID, similar like JPA's
TableGenerator
|
Table |
check(String check)
Add the table check String DDL piece if support
|
Column |
column(String columnName)
Start add a column definition piece in DDL, detail usage see demo
|
Table |
comment(String comment)
Add the table comment String DDL piece if support
|
Table |
engineTail(String engineTail)
If support engine like MySQL or MariaDB, add engineTail at the end of
"create table..." DDL, usually used to set encode String like " DEFAULT CHARSET=utf8" for MySQL
|
FKeyConstraint |
fkey(String... columnNames)
Start add a full foreign key definition in DDL, detail usage see demo
|
String |
getCheck() |
Column |
getColumn(String columnName)
Return Column object by columnName
|
Map<String,Column> |
getColumns() |
String |
getComment() |
String |
getEngineTail() |
List<FKeyConstraint> |
getFkeyConstraints() |
Map<String,Sequence> |
getSequences() |
Map<String,TableGenerator> |
getTableGenerators() |
String |
getTableName() |
void |
setCheck(String check) |
void |
setColumns(Map<String,Column> columns) |
void |
setComment(String comment) |
void |
setEngineTail(String engineTail) |
void |
setFkeyConstraints(List<FKeyConstraint> fkeyConstraints) |
void |
setSequences(Map<String,Sequence> sequences) |
void |
setTableGenerators(Map<String,TableGenerator> tableGenerators) |
void |
setTableName(String tableName) |
public Table()
public Table(String tableName)
public void addTableGenerator(TableGenerator tableGenerator)
public void addTableGenerator(String name, String tableName, String pkColumnName, String valueColumnName, String pkColumnValue, Integer initialValue, Integer allocationSize)
name - The name of TableGenerator Java object itselftableName - The name of the table will created in database to generate IDpkColumnName - The name of prime key columnvalueColumnName - The name of value columnpkColumnValue - The value in prime key columninitialValue - The initial valueallocationSize - The allocationSizepublic void addSequence(String name, String sequenceName, Integer initialValue, Integer allocationSize)
name - The name of sequence Java object itselfsequenceName - the name of the sequence will created in databaseinitialValue - The initial valueallocationSize - The allocationSizepublic void addSequence(Sequence sequence)
public Column column(String columnName)
columnName - public FKeyConstraint fkey(String... columnNames)
public Table engineTail(String engineTail)
public String getTableName()
public void setTableName(String tableName)
public String getCheck()
public void setCheck(String check)
public String getComment()
public void setComment(String comment)
public Map<String,TableGenerator> getTableGenerators()
public void setTableGenerators(Map<String,TableGenerator> tableGenerators)
public List<FKeyConstraint> getFkeyConstraints()
public void setFkeyConstraints(List<FKeyConstraint> fkeyConstraints)
public String getEngineTail()
public void setEngineTail(String engineTail)
Copyright © 2017. All rights reserved.