public abstract class AbstractDDLBuilder extends AbstractSQLBuilder implements DDLBuilder
| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<String,String> |
fieldMapping
字段类型映射
|
protected org.slf4j.Logger |
logger |
connection, PLACEHOLDER, quickDAOConfig| 构造器和说明 |
|---|
AbstractDDLBuilder(QuickDAOConfig quickDAOConfig) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
alterColumn(Property property)
修改列
|
void |
automaticCreateTableAndField()
自动建表和新增字段
|
void |
createForeignKey(Property property)
建立外键约束
|
void |
createIndex(Entity entity,
IndexType indexType)
创建索引
|
void |
createProperty(Property property)
创建新表
|
void |
createTable(Entity entity)
创建新表
|
void |
dropColumn(Property property)
删除列
|
void |
dropIndex(Entity entity,
IndexType indexType)
删除索引
|
void |
dropTable(String tableName)
删除表
|
protected abstract String |
getAutoIncrementSQL(Property property)
获取自增语句
|
protected StringBuilder |
getCreateTableBuilder(Entity entity)
获取建表语句
|
abstract List<Entity> |
getDatabaseEntity()
获取数据库信息
|
String |
getDatabaseName()
获取数据库名称
|
protected List<Entity> |
getVirtualEntity()
获取虚拟表信息
|
protected boolean |
hasConstraintExists(String tableName,
String constraintName)
判断约束是否已经存在
|
protected abstract boolean |
hasIndexExists(Entity entity,
IndexType indexType)
判断索引是否存在
|
abstract boolean |
hasTableExists(Entity entity)
判断表是否已经存在
|
void |
rebuild(Entity entity)
重建表
|
void |
refreshDbEntityList()
刷新数据库字段信息
|
protected void |
updateTableIndex(String executeSQL,
List<Property> propertyList)
更新字段索引信息
|
replaceFirst, selectCountById, selectCountByUniqueKey, setParameter, setParameterpublic AbstractDDLBuilder(QuickDAOConfig quickDAOConfig)
public String getDatabaseName() throws SQLException
DDLBuildergetDatabaseName 在接口中 DDLBuilderSQLExceptionpublic abstract List<Entity> getDatabaseEntity() throws SQLException
DDLBuildergetDatabaseEntity 在接口中 DDLBuilderSQLExceptionpublic abstract boolean hasTableExists(Entity entity) throws SQLException
DDLBuilderhasTableExists 在接口中 DDLBuilderSQLExceptionpublic 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 void createIndex(Entity entity, IndexType indexType) throws SQLException
DDLBuildercreateIndex 在接口中 DDLBuilderSQLExceptionpublic void dropIndex(Entity entity, IndexType indexType) throws SQLException
DDLBuilderdropIndex 在接口中 DDLBuilderSQLExceptionpublic void createForeignKey(Property property) throws SQLException
DDLBuildercreateForeignKey 在接口中 DDLBuilderSQLExceptionpublic void automaticCreateTableAndField()
throws SQLException
DDLBuilderautomaticCreateTableAndField 在接口中 DDLBuilderSQLExceptionpublic void refreshDbEntityList()
throws SQLException
DDLBuilderrefreshDbEntityList 在接口中 DDLBuilderSQLExceptionprotected abstract String getAutoIncrementSQL(Property property)
property - 自增字段信息protected abstract boolean hasIndexExists(Entity entity, IndexType indexType) throws SQLException
entity - 表信息indexType - 索引类型SQLExceptionprotected StringBuilder getCreateTableBuilder(Entity entity)
entity - 建表实体类protected boolean hasConstraintExists(String tableName, String constraintName) throws SQLException
tableName - 表名constraintName - 约束名称SQLExceptionprotected void updateTableIndex(String executeSQL, List<Property> propertyList) throws SQLException
executeSQL - 待执行SQL语句propertyList - 字段列表SQLExceptionCopyright © 2020. All rights reserved.