类 MysqlTableScriptCreator
java.lang.Object
net.sohelp.boot.engine.db.table.script.BaseTableScriptCreator
net.sohelp.boot.engine.db.table.script.mysql.MysqlTableScriptCreator
- 所有已实现的接口:
TableScriptInterface
MySQL表Script产生器
- 从以下版本开始:
- 2016/03/16
- 作者:
- AaronFung
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明alterField(PropertyVO propertyVO) 修改字段的SQL脚本createField(PropertyVO propertyVO) 创建字段的SQL脚本createIndexKey(String entityName, IndexKeyVO indexKeyVO) 创建索引的SQL脚本(根据索引键对象)createIndexKey(PropertyVO propertyVO) 创建索引的SQL脚本createPrimaryKey(PropertyVO propertyVO) 创建主键的SQL脚本createTable(EntityVO entityVO) 创建表的SQL脚本dropField(PropertyVO propertyVO) 删除字段的SQL脚本dropIndexKey(PropertyVO propertyVO) 删除索引的SQL脚本dropPrimaryKey(String tableName) 删除表主键的SQL脚本删除表的SQL脚本boolean检查表是否存在boolean检查字段是否存在获取SQL标识符结束符号获取所有实体对象列表根据表名获取实体对象获取所有实体名称列表getMappingType(PropertyVO propertyVO) 获取字段类型的映射关系getProperties(String tableName) 获取表的所有字段属性获取SQL标识符开始符号intgetTableFieldLength(String tableName, String fieldName) 获取数据库字段长度getTableFieldType(String tableName, String fieldName) 获取数据库字段类型booleanisExistIndexKey(PropertyVO propertyVO) 检查索引是否存在booleanisExistPrimaryKey(String tableName) 检查表是否存在主键从类继承的方法 net.sohelp.boot.engine.db.table.script.BaseTableScriptCreator
createUnique, dropUnique, getProperty, isEqualsProperty, isEqualsProperty, saveTable
-
字段详细资料
-
TYPE_MAPPING
字段类型转换映射表
-
-
构造器详细资料
-
MysqlTableScriptCreator
构造函数- 参数:
dbName- 数据库名称
-
-
方法详细资料
-
getStartSignTag
获取SQL标识符开始符号- 返回:
- 返回反引号字符
-
getEndSignTag
获取SQL标识符结束符号- 返回:
- 返回反引号字符
-
createTable
创建表的SQL脚本- 参数:
entityVO- 实体对象,包含表结构信息- 返回:
- 返回创建表的SQL语句
- 抛出:
SQLException- SQL执行异常
-
droptable
删除表的SQL脚本- 参数:
tableName- 表名- 返回:
- 返回删除表的SQL语句
-
dropField
删除字段的SQL脚本- 参数:
propertyVO- 字段属性对象- 返回:
- 返回删除字段的SQL语句
-
createField
创建字段的SQL脚本- 参数:
propertyVO- 字段属性对象- 返回:
- 返回创建字段的SQL语句
- 抛出:
SQLException- SQL执行异常
-
exist
检查字段是否存在- 指定者:
exist在接口中TableScriptInterface- 指定者:
exist在类中BaseTableScriptCreator- 参数:
tableName- 表名fieldName- 字段名- 返回:
- 存在返回true,否则返回false
- 抛出:
SQLException- SQL执行异常
-
exist
检查表是否存在- 指定者:
exist在接口中TableScriptInterface- 指定者:
exist在类中BaseTableScriptCreator- 参数:
tableName- 表名- 返回:
- 存在返回true,否则返回false
- 抛出:
SQLException- SQL执行异常
-
isExistPrimaryKey
检查表是否存在主键- 指定者:
isExistPrimaryKey在接口中TableScriptInterface- 指定者:
isExistPrimaryKey在类中BaseTableScriptCreator- 参数:
tableName- 表名- 返回:
- 存在主键返回true,否则返回false
- 抛出:
SQLException- SQL执行异常
-
dropPrimaryKey
删除表主键的SQL脚本- 指定者:
dropPrimaryKey在接口中TableScriptInterface- 指定者:
dropPrimaryKey在类中BaseTableScriptCreator- 参数:
tableName- 表名- 返回:
- 返回删除主键的SQL语句
-
createPrimaryKey
创建主键的SQL脚本- 指定者:
createPrimaryKey在接口中TableScriptInterface- 指定者:
createPrimaryKey在类中BaseTableScriptCreator- 参数:
propertyVO- 主键字段属性对象- 返回:
- 返回创建主键的SQL语句
-
getTableFieldType
获取数据库字段类型- 指定者:
getTableFieldType在接口中TableScriptInterface- 指定者:
getTableFieldType在类中BaseTableScriptCreator- 参数:
tableName- 表名fieldName- 字段名- 返回:
- 返回字段的数据类型
- 抛出:
SQLException- SQL执行异常
-
getTableFieldLength
获取数据库字段长度- 指定者:
getTableFieldLength在接口中TableScriptInterface- 指定者:
getTableFieldLength在类中BaseTableScriptCreator- 参数:
tableName- 表名fieldName- 字段名- 返回:
- 返回字段的长度,如果不存在返回-1
- 抛出:
SQLException- SQL执行异常
-
alterField
修改字段的SQL脚本- 指定者:
alterField在接口中TableScriptInterface- 指定者:
alterField在类中BaseTableScriptCreator- 参数:
propertyVO- 字段属性对象- 返回:
- 返回修改字段的SQL语句
- 抛出:
SQLException- SQL执行异常
-
getEntity
根据表名获取实体对象- 指定者:
getEntity在接口中TableScriptInterface- 指定者:
getEntity在类中BaseTableScriptCreator- 参数:
tableName- 表名- 返回:
- 返回实体对象
- 抛出:
SQLException- SQL执行异常
-
getMappingType
获取字段类型的映射关系- 指定者:
getMappingType在接口中TableScriptInterface- 指定者:
getMappingType在类中BaseTableScriptCreator- 参数:
propertyVO- 字段属性对象- 返回:
- 返回映射后的数据库字段类型
- 抛出:
SQLException- SQL执行异常
-
getEntities
获取所有实体对象列表- 指定者:
getEntities在接口中TableScriptInterface- 指定者:
getEntities在类中BaseTableScriptCreator- 返回:
- 返回实体对象列表
- 抛出:
SQLException- SQL执行异常
-
getProperties
获取表的所有字段属性- 参数:
tableName- 表名- 返回:
- 返回字段属性映射表
- 抛出:
SQLException- SQL执行异常
-
getEntityNames
获取所有实体名称列表- 返回:
- 返回实体名称列表
- 抛出:
SQLException- SQL执行异常
-
dropIndexKey
删除索引的SQL脚本- 指定者:
dropIndexKey在类中BaseTableScriptCreator- 参数:
propertyVO- 索引字段属性对象- 返回:
- 返回删除索引的SQL语句
- 抛出:
SQLException- SQL执行异常
-
createIndexKey
创建索引的SQL脚本- 指定者:
createIndexKey在类中BaseTableScriptCreator- 参数:
propertyVO- 索引字段属性对象- 返回:
- 返回创建索引的SQL语句
- 抛出:
SQLException- SQL执行异常
-
createIndexKey
创建索引的SQL脚本(根据索引键对象)- 参数:
entityName- 实体名称indexKeyVO- 索引键对象- 返回:
- 返回创建索引的SQL语句
- 抛出:
SQLException- SQL执行异常
-
isExistIndexKey
检查索引是否存在- 指定者:
isExistIndexKey在类中BaseTableScriptCreator- 参数:
propertyVO- 索引字段属性对象- 返回:
- 存在返回true,否则返回false
- 抛出:
SQLException- SQL执行异常
-