public abstract class AbstractDDLBuilder extends AbstractSQLBuilder implements DDLBuilder
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.slf4j.Logger |
logger |
connectionExecutor, PLACEHOLDER, quickDAOConfig| 构造器和说明 |
|---|
AbstractDDLBuilder(QuickDAOConfig quickDAOConfig) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
alterColumn(Property property)
修改列
|
void |
automaticCreateTableAndColumn()
自动建表和新增字段
|
void |
createForeignKey(Property property)
建立外键约束
|
void |
createIndex(IndexField indexField)
创建索引
|
void |
createProperty(Property property)
创建字段
|
abstract void |
createTable(Entity entity)
创建新表
|
void |
dropColumn(Property property)
删除列
|
void |
dropIndex(String tableName,
String indexName)
删除索引
|
void |
dropTable(String tableName)
删除表
|
protected abstract String |
getAutoIncrementSQL(Property property)
获取自增语句
|
List<Entity> |
getDatabaseEntity()
获取数据库信息
|
String |
getDatabaseName()
获取数据库名称
|
protected abstract List<Entity> |
getEntityList()
从数据库提取表信息
|
protected abstract void |
getEntityPropertyList(Entity entity)
提取表字段信息
|
protected abstract void |
getIndex(Entity entity)
提取索引信息
|
abstract Map<String,String> |
getTypeFieldMapping()
获取默认Java类型与数据库类型映射关系表
|
protected List<Entity> |
getVirtualEntity()
获取虚拟表信息
|
boolean |
hasConstraintExists(String tableName,
String constraintName)
判断约束是否存在
|
abstract boolean |
hasIndexExists(String tableName,
String indexName)
判断索引是否存在
|
abstract boolean |
hasTableExists(Entity entity)
判断表是否已经存在
|
void |
rebuild(Entity entity)
重建表
|
void |
refreshDbEntityList()
刷新数据库字段信息
|
getFieldFromInstance, replaceFirst, selectCountById, selectCountByUniqueKey, setParameter, setParameter, setPrepareStatementParameterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitenableForeignConstraintCheckpublic AbstractDDLBuilder(QuickDAOConfig quickDAOConfig)
public String getDatabaseName() throws SQLException
DDLBuildergetDatabaseName 在接口中 DDLBuilderSQLExceptionpublic List<Entity> getDatabaseEntity() throws SQLException
DDLBuildergetDatabaseEntity 在接口中 DDLBuilderSQLExceptionpublic abstract boolean hasTableExists(Entity entity) throws SQLException
DDLBuilderhasTableExists 在接口中 DDLBuilderSQLExceptionpublic abstract void createTable(Entity entity) throws SQLException
DDLBuildercreateTable 在接口中 DDLBuilderSQLExceptionpublic void createProperty(Property property) throws SQLException
DDLBuildercreateProperty 在接口中 DDLBuilderSQLExceptionpublic void alterColumn(Property property) throws SQLException
DDLBuilderalterColumn 在接口中 DDLBuilderSQLExceptionpublic void dropColumn(Property property) throws SQLException
DDLBuilderdropColumn 在接口中 DDLBuilderSQLExceptionpublic void dropTable(String tableName) throws SQLException
DDLBuilderdropTable 在接口中 DDLBuilderSQLExceptionpublic void rebuild(Entity entity) throws SQLException
DDLBuilderrebuild 在接口中 DDLBuilderSQLExceptionpublic abstract boolean hasIndexExists(String tableName, String indexName) throws SQLException
DDLBuilderhasIndexExists 在接口中 DDLBuildertableName - 表名indexName - 索引名称SQLExceptionpublic boolean hasConstraintExists(String tableName, String constraintName) throws SQLException
DDLBuilderhasConstraintExists 在接口中 DDLBuildertableName - 表名constraintName - 约束名称SQLExceptionpublic void createIndex(IndexField indexField) throws SQLException
DDLBuildercreateIndex 在接口中 DDLBuilderindexField - 索引字段SQLExceptionpublic void dropIndex(String tableName, String indexName) throws SQLException
DDLBuilderdropIndex 在接口中 DDLBuildertableName - 表名indexName - 索引名称SQLExceptionpublic void createForeignKey(Property property) throws SQLException
DDLBuildercreateForeignKey 在接口中 DDLBuilderSQLExceptionpublic void automaticCreateTableAndColumn()
throws SQLException
DDLBuilderautomaticCreateTableAndColumn 在接口中 DDLBuilderSQLExceptionpublic void refreshDbEntityList()
throws SQLException
DDLBuilderrefreshDbEntityList 在接口中 DDLBuilderSQLExceptionpublic abstract Map<String,String> getTypeFieldMapping()
DDLBuildergetTypeFieldMapping 在接口中 DDLBuilderprotected abstract String getAutoIncrementSQL(Property property)
property - 自增字段信息protected abstract void getIndex(Entity entity) throws SQLException
SQLExceptionprotected abstract void getEntityPropertyList(Entity entity) throws SQLException
SQLExceptionprotected abstract List<Entity> getEntityList() throws SQLException
SQLExceptionCopyright © 2021. All rights reserved.