public abstract class AbstractTableBuilder extends Object implements TableBuilder
| 限定符和类型 | 字段和说明 |
|---|---|
Connection |
connection
数据库连接
|
protected Map<String,String> |
fieldMapping
字段类型映射
|
protected org.slf4j.Logger |
logger |
QuickDAOConfig |
quickDAOConfig
数据库配置项
|
| 构造器和说明 |
|---|
AbstractTableBuilder(QuickDAOConfig quickDAOConfig) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
alterColumn(Property property)
修改列
|
void |
autoBuildDatabase() |
void |
createIndex(Entity entity,
IndexType indexType)
创建索引
|
void |
createTable(Entity entity)
创建新表
|
void |
dropIndex(Entity entity,
IndexType indexType)
删除索引
|
void |
dropTable(Entity entity)
删除表
|
abstract String |
getAutoIncrementSQL(Property property)
创建自增列SQL语句
|
abstract Entity[] |
getDatabaseEntity()
获取数据库信息
|
boolean |
hasConstraintExists(String tableName,
String constraintName)
判断外键约束是否已经存在
|
abstract boolean |
hasIndexExists(Entity entity,
IndexType indexType)
判断索引是否已经存在
|
abstract boolean |
hasTableExists(Entity entity)
判断表是否已经存在
|
void |
rebuild(Entity entity)
重建表
|
protected org.slf4j.Logger logger
public Connection connection
public QuickDAOConfig quickDAOConfig
public AbstractTableBuilder(QuickDAOConfig quickDAOConfig)
public abstract Entity[] getDatabaseEntity() throws SQLException
TableBuildergetDatabaseEntity 在接口中 TableBuilderSQLExceptionpublic abstract String getAutoIncrementSQL(Property property)
TableBuildergetAutoIncrementSQL 在接口中 TableBuilderpublic abstract boolean hasTableExists(Entity entity) throws SQLException
TableBuilderhasTableExists 在接口中 TableBuilderSQLExceptionpublic void createTable(Entity entity) throws SQLException
TableBuildercreateTable 在接口中 TableBuilderSQLExceptionpublic void alterColumn(Property property) throws SQLException
TableBuilderalterColumn 在接口中 TableBuilderSQLExceptionpublic void dropTable(Entity entity) throws SQLException
TableBuilderdropTable 在接口中 TableBuilderSQLExceptionpublic void rebuild(Entity entity) throws SQLException
TableBuilderrebuild 在接口中 TableBuilderSQLExceptionpublic abstract boolean hasIndexExists(Entity entity, IndexType indexType) throws SQLException
TableBuilderhasIndexExists 在接口中 TableBuilderSQLExceptionpublic void createIndex(Entity entity, IndexType indexType) throws SQLException
TableBuildercreateIndex 在接口中 TableBuilderentity - 实体表信息indexType - 索引类型SQLExceptionpublic boolean hasConstraintExists(String tableName, String constraintName) throws SQLException
TableBuilderhasConstraintExists 在接口中 TableBuilderSQLExceptionpublic void dropIndex(Entity entity, IndexType indexType) throws SQLException
TableBuilderdropIndex 在接口中 TableBuilderSQLExceptionpublic void autoBuildDatabase()
throws SQLException
SQLExceptionCopyright © 2019. All rights reserved.