public class Mssql2000TableScriptCreator extends BaseTableScriptCreator
| 限定符和类型 | 字段和说明 |
|---|---|
static Map<String,String> |
TYPE_MAPPING
类型映射表:将通用数据类型映射到 MSSQL 对应的数据库字段类型
|
| 构造器和说明 |
|---|
Mssql2000TableScriptCreator(String dbName)
构造方法,初始化数据库名称
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
alterField(PropertyVO propertyVO)
修改字段类型或长度的SQL语句
|
String |
createField(PropertyVO propertyVO)
添加新字段的SQL语句
|
String |
createIndexKey(PropertyVO propertyVO)
创建索引的SQL语句
|
String |
createPrimaryKey(PropertyVO propertyVO)
创建主键约束
|
String |
createTable(EntityVO entityVO)
根据实体对象生成建表语句
|
String |
dropField(PropertyVO propertyVO)
删除指定字段的SQL语句
|
String |
dropIndexKey(PropertyVO propertyVO)
删除索引的SQL语句
|
String |
dropPrimaryKey(String tableName)
删除表中的主键约束
|
String |
droptable(String tableName)
删除指定表的SQL语句
|
boolean |
exist(String tableName)
判断某张表是否存在
|
boolean |
exist(String tableName,
String fieldName)
判断某个字段是否存在于指定表中
|
String |
getEndSignTag()
获取右标识符(如 ])
|
List<EntityVO> |
getEntities()
获取当前数据库中所有的表信息
|
EntityVO |
getEntity(String tableName)
获取表的所有字段信息并封装成EntityVO对象
|
List<String> |
getEntityNames()
获取当前数据库中所有表的名称列表
|
String |
getMappingType(PropertyVO propertyVO)
获取字段对应的数据库类型
|
Map<String,PropertyVO> |
getProperties(String tableName)
获取表中所有字段的信息,并以Map形式返回
|
String |
getStartSignTag()
获取左标识符(如 [)
|
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 Mssql2000TableScriptCreator(String dbName)
dbName - 数据库名称public String getStartSignTag()
public String getEndSignTag()
public String createTable(EntityVO entityVO) throws SQLException
entityVO - 实体信息对象SQLException - 当执行过程中发生异常时抛出public String dropField(PropertyVO propertyVO)
propertyVO - 字段属性对象public String createField(PropertyVO propertyVO) throws SQLException
propertyVO - 字段属性对象SQLException - 当执行过程中发生异常时抛出public boolean exist(String tableName, String fieldName) throws SQLException
exist 在接口中 TableScriptInterfaceexist 在类中 BaseTableScriptCreatortableName - 表名fieldName - 字段名SQLException - 当查询失败时抛出public boolean exist(String tableName) throws SQLException
exist 在接口中 TableScriptInterfaceexist 在类中 BaseTableScriptCreatortableName - 表名SQLException - 当查询失败时抛出public boolean isExistPrimaryKey(String tableName) throws SQLException
isExistPrimaryKey 在接口中 TableScriptInterfaceisExistPrimaryKey 在类中 BaseTableScriptCreatortableName - 表名SQLException - 查询失败时抛出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 - 查询失败时抛出public int getTableFieldLength(String tableName, String fieldName) throws SQLException
getTableFieldLength 在接口中 TableScriptInterfacegetTableFieldLength 在类中 BaseTableScriptCreatortableName - 表名fieldName - 字段名SQLException - 查询失败时抛出public String alterField(PropertyVO propertyVO) throws SQLException
alterField 在接口中 TableScriptInterfacealterField 在类中 BaseTableScriptCreatorpropertyVO - 字段属性对象SQLException - 执行失败时抛出public EntityVO getEntity(String tableName) throws SQLException
getEntity 在接口中 TableScriptInterfacegetEntity 在类中 BaseTableScriptCreatortableName - 表名SQLException - 查询失败时抛出public Map<String,PropertyVO> getProperties(String tableName) throws SQLException
tableName - 表名SQLException - 查询失败时抛出public String getMappingType(PropertyVO propertyVO) throws SQLException
getMappingType 在接口中 TableScriptInterfacegetMappingType 在类中 BaseTableScriptCreatorpropertyVO - 字段属性对象SQLException - 映射失败时抛出public List<EntityVO> getEntities() throws SQLException
getEntities 在接口中 TableScriptInterfacegetEntities 在类中 BaseTableScriptCreatorSQLException - 查询失败时抛出public List<String> getEntityNames() throws SQLException
SQLException - 查询失败时抛出public String dropIndexKey(PropertyVO propertyVO) throws SQLException
dropIndexKey 在类中 BaseTableScriptCreatorpropertyVO - 索引字段属性对象SQLException - 查询失败时抛出public String createIndexKey(PropertyVO propertyVO) throws SQLException
createIndexKey 在类中 BaseTableScriptCreatorpropertyVO - 索引字段属性对象SQLException - 查询失败时抛出public boolean isExistIndexKey(PropertyVO propertyVO) throws SQLException
isExistIndexKey 在类中 BaseTableScriptCreatorpropertyVO - 索引字段属性对象SQLException - 查询失败时抛出Copyright © 2025. All rights reserved.