|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.drinkjava2.jdialects.model.Table
public class Table
The platform-independent table model
| Constructor Summary | |
|---|---|
Table()
|
|
Table(String tableName)
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Table()
public Table(String tableName)
| Method Detail |
|---|
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 allocationSize
public 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 Table check(String check)
public Table comment(String comment)
public Table addColumn(Column column)
public Column column(String columnName)
columnName -
public Column getColumn(String 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,Column> getColumns()
public void setColumns(Map<String,Column> columns)
public Map<String,Sequence> getSequences()
public void setSequences(Map<String,Sequence> sequences)
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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||