public class TableMeta extends Object implements Jsonizable
| 构造器和说明 |
|---|
TableMeta(String tableName)
Creates a new
TableMeta instance with the given table name. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addAutoIncrementPrimaryKeyColumn(String name)
Add a primary key auto-increment column.
|
void |
addDefinedColumn(DefinedColumnSchema column)
Add a predefined column.
|
void |
addDefinedColumn(String name,
DefinedColumnType type)
Add a predefined column.
|
void |
addDefinedColumns(DefinedColumnSchema[] columns)
Add a set of predefined columns.
|
void |
addDefinedColumns(List<DefinedColumnSchema> columns)
Add a set of predefined columns.
|
void |
addPrimaryKeyColumn(PrimaryKeySchema key)
Add a primary key column.
|
void |
addPrimaryKeyColumn(String name,
PrimaryKeyType type)
Add a primary key column.
|
void |
addPrimaryKeyColumn(String name,
PrimaryKeyType type,
PrimaryKeyOption option)
Add a primary key column.
|
void |
addPrimaryKeyColumns(List<PrimaryKeySchema> pks)
Add a set of primary key columns.
|
void |
addPrimaryKeyColumns(PrimaryKeySchema[] pks)
Add a set of primary key columns.
|
Map<String,DefinedColumnType> |
getDefinedColumnMap()
Returns the dictionary of predefined column names and their corresponding types.
|
Map<String,DefinedColumnSchema> |
getDefinedColumnSchemaMap()
Returns the dictionary corresponding to the column names and type definitions of predefined columns.
|
List<DefinedColumnSchema> |
getDefinedColumnsList()
Returns a read-only list containing all predefined column definitions.
|
List<PrimaryKeySchema> |
getPrimaryKeyList()
Returns a read-only list containing definitions of all primary key columns.
|
Map<String,PrimaryKeyType> |
getPrimaryKeyMap()
Returns the dictionary corresponding to the column names and types of the primary key.
|
Map<String,PrimaryKeySchema> |
getPrimaryKeySchemaMap()
Returns the dictionary of correspondence between the column names and type definitions of the primary key.
|
String |
getTableName()
Returns the name of the table.
|
String |
jsonize() |
void |
jsonize(StringBuilder sb,
String newline) |
void |
setTableName(String tableName)
Sets the name of the table.
|
String |
toString() |
public TableMeta(String tableName)
TableMeta instance with the given table name.tableName - The name of the table.public String getTableName()
public void setTableName(String tableName)
tableName - The name of the table.public Map<String,PrimaryKeyType> getPrimaryKeyMap()
public Map<String,PrimaryKeySchema> getPrimaryKeySchemaMap()
public List<PrimaryKeySchema> getPrimaryKeyList()
public void addPrimaryKeyColumn(String name, PrimaryKeyType type)
The order of primary keys in the final created table will be the same as the order in which the user adds the primary keys.
name - The name of the primary key column.type - The data type of the primary key column.public void addPrimaryKeyColumn(String name, PrimaryKeyType type, PrimaryKeyOption option)
The order of primary keys in the final created table will be the same as the order in which the user adds the primary keys.
name - The name of the primary key column.type - The data type of the primary key column.option - The attribute of the primary key column.public void addAutoIncrementPrimaryKeyColumn(String name)
The order of primary keys in the final created table will be the same as the order in which the user adds the primary keys.
name - The name of the primary key auto-increment column.public void addPrimaryKeyColumn(PrimaryKeySchema key)
The order of primary keys in the final created table will be the same as the order in which the user adds the primary keys.
key - The definition of the primary key columnpublic void addPrimaryKeyColumns(List<PrimaryKeySchema> pks)
The order of the primary keys in the final created table will be the same as the order in which the user adds the primary keys.
pks - Definition of the primary key columnspublic void addPrimaryKeyColumns(PrimaryKeySchema[] pks)
The order of primary keys in the final created table will be the same as the order in which the user adds the primary keys.
pks - Definition of the primary key columnspublic Map<String,DefinedColumnType> getDefinedColumnMap()
public Map<String,DefinedColumnSchema> getDefinedColumnSchemaMap()
public List<DefinedColumnSchema> getDefinedColumnsList()
public void addDefinedColumn(String name, DefinedColumnType type)
name - The name of the predefined column.type - The data type of the predefined column.public void addDefinedColumn(DefinedColumnSchema column)
column - The definition of the predefined columnpublic void addDefinedColumns(List<DefinedColumnSchema> columns)
columns - The definition of predefined columnspublic void addDefinedColumns(DefinedColumnSchema[] columns)
columns - The definition of predefined columnspublic String jsonize()
jsonize 在接口中 Jsonizablepublic void jsonize(StringBuilder sb, String newline)
jsonize 在接口中 JsonizableCopyright © 2025. All Rights Reserved.