public interface DDLBuilder
| 限定符和类型 | 方法和说明 |
|---|---|
void |
alterColumn(Property property)
修改列
|
void |
automaticCreateTableAndColumn()
自动建表和新增字段
|
void |
createForeignKey(Property property)
建立外键约束
|
void |
createIndex(IndexField indexField)
创建索引
|
void |
createProperty(Property property)
创建字段
|
void |
createTable(Entity entity)
创建新表
|
void |
dropColumn(Property property)
删除列
|
void |
dropIndex(String tableName,
String indexName)
删除索引
|
void |
dropTable(String tableName)
删除表
|
void |
enableForeignConstraintCheck(boolean enable)
是否开启外键约束检查
|
List<Entity> |
getDatabaseEntity()
获取数据库信息
|
String |
getDatabaseName()
获取数据库名称
|
Map<String,String> |
getTypeFieldMapping()
获取默认Java类型与数据库类型映射关系表
|
boolean |
hasConstraintExists(String tableName,
String constraintName)
判断约束是否存在
|
boolean |
hasIndexExists(String tableName,
String indexName)
判断索引是否存在
|
boolean |
hasTableExists(Entity entity)
判断表是否已经存在
|
void |
rebuild(Entity entity)
重建表
|
void |
refreshDbEntityList()
刷新数据库字段信息
|
String getDatabaseName() throws SQLException
SQLExceptionList<Entity> getDatabaseEntity() throws SQLException
SQLExceptionboolean hasTableExists(Entity entity) throws SQLException
SQLExceptionvoid createTable(Entity entity) throws SQLException
SQLExceptionvoid createProperty(Property property) throws SQLException
SQLExceptionvoid alterColumn(Property property) throws SQLException
SQLExceptionvoid dropColumn(Property property) throws SQLException
SQLExceptionvoid dropTable(String tableName) throws SQLException
SQLExceptionvoid rebuild(Entity entity) throws SQLException
SQLExceptionboolean hasIndexExists(String tableName, String indexName) throws SQLException
tableName - 表名indexName - 索引名称SQLExceptionboolean hasConstraintExists(String tableName, String constraintName) throws SQLException
tableName - 表名constraintName - 约束名称SQLExceptionvoid createIndex(IndexField indexField) throws SQLException
indexField - 索引字段SQLExceptionvoid dropIndex(String tableName, String indexName) throws SQLException
tableName - 表名indexName - 索引名称SQLExceptionvoid createForeignKey(Property property) throws SQLException
SQLExceptionvoid enableForeignConstraintCheck(boolean enable)
throws SQLException
SQLExceptionvoid automaticCreateTableAndColumn()
throws SQLException
SQLExceptionvoid refreshDbEntityList()
throws SQLException
SQLExceptionCopyright © 2021. All rights reserved.