类 Mssql2000TableScriptCreator
java.lang.Object
net.sohelp.boot.engine.db.table.script.BaseTableScriptCreator
net.sohelp.boot.engine.db.table.script.mssql.Mssql2000TableScriptCreator
- 所有已实现的接口:
TableScriptInterface
MSSQL 2000 表结构脚本创建器。
提供了用于生成、修改、删除表及字段的相关 SQL 脚本功能。
- 从以下版本开始:
- 2016/03/16
- 作者:
- AaronFung
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明alterField(PropertyVO propertyVO) 修改字段类型或长度的SQL语句createField(PropertyVO propertyVO) 添加新字段的SQL语句createIndexKey(PropertyVO propertyVO) 创建索引的SQL语句createPrimaryKey(PropertyVO propertyVO) 创建主键约束createTable(EntityVO entityVO) 根据实体对象生成建表语句dropField(PropertyVO propertyVO) 删除指定字段的SQL语句dropIndexKey(PropertyVO propertyVO) 删除索引的SQL语句dropPrimaryKey(String tableName) 删除表中的主键约束删除指定表的SQL语句boolean判断某张表是否存在boolean判断某个字段是否存在于指定表中获取右标识符(如 ])获取当前数据库中所有的表信息获取表的所有字段信息并封装成EntityVO对象获取当前数据库中所有表的名称列表getMappingType(PropertyVO propertyVO) 获取字段对应的数据库类型getProperties(String tableName) 获取表中所有字段的信息,并以Map形式返回获取左标识符(如 [)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
类型映射表:将通用数据类型映射到 MSSQL 对应的数据库字段类型
-
-
构造器详细资料
-
Mssql2000TableScriptCreator
构造方法,初始化数据库名称- 参数:
dbName- 数据库名称
-
-
方法详细资料
-
getStartSignTag
获取左标识符(如 [)- 返回:
- 左标识符字符串
-
getEndSignTag
获取右标识符(如 ])- 返回:
- 右标识符字符串
-
createTable
根据实体对象生成建表语句- 参数:
entityVO- 实体信息对象- 返回:
- 建表SQL语句
- 抛出:
SQLException- 当执行过程中发生异常时抛出
-
droptable
删除指定表的SQL语句- 参数:
tableName- 表名- 返回:
- 删除表的SQL语句
-
dropField
删除指定字段的SQL语句- 参数:
propertyVO- 字段属性对象- 返回:
- 删除字段的SQL语句
-
createField
添加新字段的SQL语句- 参数:
propertyVO- 字段属性对象- 返回:
- 添加字段的SQL语句
- 抛出:
SQLException- 当执行过程中发生异常时抛出
-
exist
判断某个字段是否存在于指定表中- 指定者:
exist在接口中TableScriptInterface- 指定者:
exist在类中BaseTableScriptCreator- 参数:
tableName- 表名fieldName- 字段名- 返回:
- 是否存在该字段
- 抛出:
SQLException- 当查询失败时抛出
-
exist
判断某张表是否存在- 指定者:
exist在接口中TableScriptInterface- 指定者:
exist在类中BaseTableScriptCreator- 参数:
tableName- 表名- 返回:
- 是否存在该表
- 抛出:
SQLException- 当查询失败时抛出
-
isExistPrimaryKey
检查指定表是否有主键- 指定者:
isExistPrimaryKey在接口中TableScriptInterface- 指定者:
isExistPrimaryKey在类中BaseTableScriptCreator- 参数:
tableName- 表名- 返回:
- 是否有主键
- 抛出:
SQLException- 查询失败时抛出
-
dropPrimaryKey
删除表中的主键约束- 指定者:
dropPrimaryKey在接口中TableScriptInterface- 指定者:
dropPrimaryKey在类中BaseTableScriptCreator- 参数:
tableName- 表名- 返回:
- 删除主键约束的SQL语句
-
createPrimaryKey
创建主键约束- 指定者:
createPrimaryKey在接口中TableScriptInterface- 指定者:
createPrimaryKey在类中BaseTableScriptCreator- 参数:
propertyVO- 主键字段属性对象- 返回:
- 创建主键约束的SQL语句
-
getTableFieldType
获取真实数据库的字段的类型- 指定者:
getTableFieldType在接口中TableScriptInterface- 指定者:
getTableFieldType在类中BaseTableScriptCreator- 参数:
tableName- 表名fieldName- 字段名- 返回:
- 字段类型名称
- 抛出:
SQLException- 查询失败时抛出
-
getTableFieldLength
获取真实的数据字段长度- 指定者:
getTableFieldLength在接口中TableScriptInterface- 指定者:
getTableFieldLength在类中BaseTableScriptCreator- 参数:
tableName- 表名fieldName- 字段名- 返回:
- 字段长度
- 抛出:
SQLException- 查询失败时抛出
-
alterField
修改字段类型或长度的SQL语句- 指定者:
alterField在接口中TableScriptInterface- 指定者:
alterField在类中BaseTableScriptCreator- 参数:
propertyVO- 字段属性对象- 返回:
- 修改字段的SQL语句
- 抛出:
SQLException- 执行失败时抛出
-
getEntity
获取表的所有字段信息并封装成EntityVO对象- 指定者:
getEntity在接口中TableScriptInterface- 指定者:
getEntity在类中BaseTableScriptCreator- 参数:
tableName- 表名- 返回:
- 包含字段信息的EntityVO对象
- 抛出:
SQLException- 查询失败时抛出
-
getProperties
获取表中所有字段的信息,并以Map形式返回- 参数:
tableName- 表名- 返回:
- 字段名与字段信息的映射关系
- 抛出:
SQLException- 查询失败时抛出
-
getMappingType
获取字段对应的数据库类型- 指定者:
getMappingType在接口中TableScriptInterface- 指定者:
getMappingType在类中BaseTableScriptCreator- 参数:
propertyVO- 字段属性对象- 返回:
- 映射后的数据库字段类型
- 抛出:
SQLException- 映射失败时抛出
-
getEntities
获取当前数据库中所有的表信息- 指定者:
getEntities在接口中TableScriptInterface- 指定者:
getEntities在类中BaseTableScriptCreator- 返回:
- 所有表的EntityVO列表
- 抛出:
SQLException- 查询失败时抛出
-
getEntityNames
获取当前数据库中所有表的名称列表- 返回:
- 表名列表
- 抛出:
SQLException- 查询失败时抛出
-
dropIndexKey
删除索引的SQL语句- 指定者:
dropIndexKey在类中BaseTableScriptCreator- 参数:
propertyVO- 索引字段属性对象- 返回:
- 删除索引的SQL语句
- 抛出:
SQLException- 查询失败时抛出
-
createIndexKey
创建索引的SQL语句- 指定者:
createIndexKey在类中BaseTableScriptCreator- 参数:
propertyVO- 索引字段属性对象- 返回:
- 创建索引的SQL语句
- 抛出:
SQLException- 查询失败时抛出
-
isExistIndexKey
判断指定字段上的索引是否存在- 指定者:
isExistIndexKey在类中BaseTableScriptCreator- 参数:
propertyVO- 索引字段属性对象- 返回:
- 是否存在该索引
- 抛出:
SQLException- 查询失败时抛出
-