public class MysqlTableScriptCreator extends BaseTableScriptCreator
| 限定符和类型 | 字段和说明 |
|---|---|
static Map<String,String> |
TYPE_MAPPING
字段类型转换映射表
|
| 构造器和说明 |
|---|
MysqlTableScriptCreator(String dbName)
构造函数
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
alterField(PropertyVO propertyVO)
修改字段的SQL脚本
|
String |
createField(PropertyVO propertyVO)
创建字段的SQL脚本
|
String |
createIndexKey(PropertyVO propertyVO)
创建索引的SQL脚本
|
String |
createIndexKey(String entityName,
IndexKeyVO indexKeyVO)
创建索引的SQL脚本(根据索引键对象)
|
String |
createPrimaryKey(PropertyVO propertyVO)
创建主键的SQL脚本
|
String |
createTable(EntityVO entityVO)
创建表的SQL脚本
|
String |
dropField(PropertyVO propertyVO)
删除字段的SQL脚本
|
String |
dropIndexKey(PropertyVO propertyVO)
删除索引的SQL脚本
|
String |
dropPrimaryKey(String tableName)
删除表主键的SQL脚本
|
String |
droptable(String tableName)
删除表的SQL脚本
|
boolean |
exist(String tableName)
检查表是否存在
|
boolean |
exist(String tableName,
String fieldName)
检查字段是否存在
|
String |
getEndSignTag()
获取SQL标识符结束符号
|
List<EntityVO> |
getEntities()
获取所有实体对象列表
|
EntityVO |
getEntity(String tableName)
根据表名获取实体对象
|
List<String> |
getEntityNames()
获取所有实体名称列表
|
String |
getMappingType(PropertyVO propertyVO)
获取字段类型的映射关系
|
Map<String,PropertyVO> |
getProperties(String tableName)
获取表的所有字段属性
|
String |
getStartSignTag()
获取SQL标识符开始符号
|
int |
getTableFieldLength(String tableName,
String fieldName)
获取数据库字段长度
|
String |
getTableFieldType(String tableName,
String fieldName)
获取数据库字段类型
|
boolean |
isExistIndexKey(PropertyVO propertyVO)
检查索引是否存在
|
boolean |
isExistPrimaryKey(String tableName)
检查表是否存在主键
|
createUnique, dropUnique, getProperty, isEqualsProperty, isEqualsProperty, saveTablepublic MysqlTableScriptCreator(String dbName)
dbName - 数据库名称public String getStartSignTag()
public String getEndSignTag()
public String createTable(EntityVO entityVO) throws SQLException
entityVO - 实体对象,包含表结构信息SQLException - SQL执行异常public String dropField(PropertyVO propertyVO)
propertyVO - 字段属性对象public String createField(PropertyVO propertyVO) throws SQLException
propertyVO - 字段属性对象SQLException - SQL执行异常public boolean exist(String tableName, String fieldName) throws SQLException
exist 在接口中 TableScriptInterfaceexist 在类中 BaseTableScriptCreatortableName - 表名fieldName - 字段名SQLException - SQL执行异常public boolean exist(String tableName) throws SQLException
exist 在接口中 TableScriptInterfaceexist 在类中 BaseTableScriptCreatortableName - 表名SQLException - SQL执行异常public boolean isExistPrimaryKey(String tableName) throws SQLException
isExistPrimaryKey 在接口中 TableScriptInterfaceisExistPrimaryKey 在类中 BaseTableScriptCreatortableName - 表名SQLException - SQL执行异常public String dropPrimaryKey(String tableName)
dropPrimaryKey 在接口中 TableScriptInterfacedropPrimaryKey 在类中 BaseTableScriptCreatortableName - 表名public String createPrimaryKey(PropertyVO propertyVO)
createPrimaryKey 在接口中 TableScriptInterfacecreatePrimaryKey 在类中 BaseTableScriptCreatorpropertyVO - 主键字段属性对象public String getTableFieldType(String tableName, String fieldName) throws SQLException
getTableFieldType 在接口中 TableScriptInterfacegetTableFieldType 在类中 BaseTableScriptCreatortableName - 表名fieldName - 字段名SQLException - SQL执行异常public int getTableFieldLength(String tableName, String fieldName) throws SQLException
getTableFieldLength 在接口中 TableScriptInterfacegetTableFieldLength 在类中 BaseTableScriptCreatortableName - 表名fieldName - 字段名SQLException - SQL执行异常public String alterField(PropertyVO propertyVO) throws SQLException
alterField 在接口中 TableScriptInterfacealterField 在类中 BaseTableScriptCreatorpropertyVO - 字段属性对象SQLException - SQL执行异常public EntityVO getEntity(String tableName) throws SQLException
getEntity 在接口中 TableScriptInterfacegetEntity 在类中 BaseTableScriptCreatortableName - 表名SQLException - SQL执行异常public String getMappingType(PropertyVO propertyVO) throws SQLException
getMappingType 在接口中 TableScriptInterfacegetMappingType 在类中 BaseTableScriptCreatorpropertyVO - 字段属性对象SQLException - SQL执行异常public List<EntityVO> getEntities() throws SQLException
getEntities 在接口中 TableScriptInterfacegetEntities 在类中 BaseTableScriptCreatorSQLException - SQL执行异常public Map<String,PropertyVO> getProperties(String tableName) throws SQLException
tableName - 表名SQLException - SQL执行异常public List<String> getEntityNames() throws SQLException
SQLException - SQL执行异常public String dropIndexKey(PropertyVO propertyVO) throws SQLException
dropIndexKey 在类中 BaseTableScriptCreatorpropertyVO - 索引字段属性对象SQLException - SQL执行异常public String createIndexKey(PropertyVO propertyVO) throws SQLException
createIndexKey 在类中 BaseTableScriptCreatorpropertyVO - 索引字段属性对象SQLException - SQL执行异常public String createIndexKey(String entityName, IndexKeyVO indexKeyVO) throws SQLException
entityName - 实体名称indexKeyVO - 索引键对象SQLException - SQL执行异常public boolean isExistIndexKey(PropertyVO propertyVO) throws SQLException
isExistIndexKey 在类中 BaseTableScriptCreatorpropertyVO - 索引字段属性对象SQLException - SQL执行异常Copyright © 2025. All rights reserved.