public interface DDLDAO
| 限定符和类型 | 方法和说明 |
|---|---|
void |
alterColumn(Property property)
修改列
|
void |
automaticCreateTableAndColumn()
自动建表和新增字段
|
void |
create(Class clazz)
建表
|
void |
create(Entity entity)
建表
|
void |
createColumn(String tableName,
Property property)
新增列
|
void |
createForeignKey(Property property)
创建外键约束
|
void |
createIndex(IndexField indexField)
新增索引
|
Property |
dropColumn(String tableName,
String column)
删除列
|
void |
dropIndex(String tableName,
String indexName)
删除索引
|
void |
dropTable(Class clazz)
删表
|
void |
dropTable(String tableName)
删表
|
void |
enableForeignConstraintCheck(boolean enable)
是否开启外键约束检查
|
Map<String,String> |
getTypeFieldMapping()
获取Java类型到数据库字段类型映射表
|
boolean |
hasConstraintExists(String tableName,
String indexName)
约束否存在
|
boolean |
hasIndex(String tableName,
String indexName)
索引是否存在
|
boolean |
hasTableExists(Class clazz)
表是否存在
|
void |
rebuild(Class clazz)
重建表
|
void |
rebuild(String tableName)
重建表
|
void |
refreshDbEntityList()
重新获取数据库信息
|
void |
syncEntityList()
双向同步扫描实体类信息和数据库表信息
|
boolean hasTableExists(Class clazz)
void create(Class clazz)
void create(Entity entity)
void dropTable(Class clazz)
void dropTable(String tableName)
void rebuild(Class clazz)
void rebuild(String tableName)
void createColumn(String tableName, Property property)
tableName - 表名property - 字段属性void alterColumn(Property property)
property - 列信息boolean hasIndex(String tableName, String indexName)
tableName - 表名indexName - 索引名称boolean hasConstraintExists(String tableName, String indexName)
tableName - 表名indexName - 约束名称void createIndex(IndexField indexField)
indexField - 索引信息void dropIndex(String tableName, String indexName)
tableName - 表名indexName - 索引名称void createForeignKey(Property property)
property - 数据库列void enableForeignConstraintCheck(boolean enable)
void syncEntityList()
void automaticCreateTableAndColumn()
void refreshDbEntityList()
Copyright © 2021. All rights reserved.