接口 TableScriptInterface

所有已知实现类:
BaseTableScriptCreator, Mssql2000TableScriptCreator, MysqlTableScriptCreator

public interface TableScriptInterface
表脚本接口 定义了表脚本操作的标准接口,用于处理数据库表的相关脚本操作
从以下版本开始:
2016/03/16
作者:
AaronFung
  • 方法详细资料

    • getProperties

      Map<String,PropertyVO> getProperties(String tableName) throws SQLException
      根据表名获取属性信息映射
      参数:
      tableName - 表名,用于查询对应的属性信息
      返回:
      返回属性名称到PropertyVO对象的映射关系
      抛出:
      SQLException - 当数据库操作发生错误时抛出此异常
    • getProperty

      PropertyVO getProperty(String tableName, String fieldName) throws SQLException
      根据表名和字段名获取属性信息
      参数:
      tableName - 表名
      fieldName - 字段名
      返回:
      PropertyVO 属性信息对象
      抛出:
      SQLException - 数据库操作异常
    • isEqualsProperty

      boolean isEqualsProperty(PropertyVO xmlProperty, PropertyVO fieldPropertyVO) throws SQLException
      比较两个属性对象是否相等
      参数:
      xmlProperty - XML配置中的属性对象
      fieldPropertyVO - 数据库字段对应的属性对象
      返回:
      boolean 如果两个属性相等返回true,否则返回false
      抛出:
      SQLException - 数据库操作异常
    • exist

      boolean exist(String tableName, String fieldName) throws SQLException
      检查指定表中是否存在指定字段
      参数:
      tableName - 要检查的表名,不能为空
      fieldName - 要检查的字段名,不能为空
      返回:
      如果表中存在该字段则返回true,否则返回false
      抛出:
      SQLException - 当数据库操作发生错误时抛出
    • exist

      boolean exist(String tableName) throws SQLException
      检查指定表是否存在
      参数:
      tableName - 表名
      返回:
      如果表存在返回true,否则返回false
      抛出:
      SQLException - 数据库操作异常
    • createTable

      String createTable(EntityVO entityVO) throws SQLException
      根据实体信息创建数据表
      参数:
      entityVO - 实体信息对象
      返回:
      创建表的SQL语句
      抛出:
      SQLException - 数据库操作异常
    • droptable

      String droptable(String tableName)
      删除指定表
      参数:
      tableName - 表名
      返回:
      删除表的SQL语句
    • dropField

      String dropField(PropertyVO propertyVO)
      删除字段
      参数:
      propertyVO - 字段属性信息对象
      返回:
      删除字段的SQL语句
    • getMappingType

      String getMappingType(PropertyVO propertyVO) throws SQLException
      获取字段的映射类型
      参数:
      propertyVO - 字段属性信息对象
      返回:
      映射类型字符串
      抛出:
      SQLException - 数据库操作异常
    • createField

      String createField(PropertyVO propertyVO) throws SQLException
      创建字段
      参数:
      propertyVO - 字段属性信息对象
      返回:
      创建字段的SQL语句
      抛出:
      SQLException - 数据库操作异常
    • isExistPrimaryKey

      boolean isExistPrimaryKey(String tableName) throws SQLException
      检查指定表是否存在主键
      参数:
      tableName - 表名
      返回:
      如果存在主键返回true,否则返回false
      抛出:
      SQLException - 数据库操作异常
    • dropPrimaryKey

      String dropPrimaryKey(String tableName)
      删除表的主键约束
      参数:
      tableName - 表名
      返回:
      删除主键的SQL语句
    • createPrimaryKey

      String createPrimaryKey(PropertyVO propertyVO)
      为主键字段创建主键约束
      参数:
      propertyVO - 主键字段属性信息对象
      返回:
      创建主键的SQL语句
    • getTableFieldType

      String getTableFieldType(String tableName, String fieldName) throws SQLException
      获取表中指定字段的数据类型
      参数:
      tableName - 表名
      fieldName - 字段名
      返回:
      字段数据类型
      抛出:
      SQLException - 数据库操作异常
    • getTableFieldLength

      int getTableFieldLength(String tableName, String fieldName) throws SQLException
      获取表中指定字段的长度
      参数:
      tableName - 表名
      fieldName - 字段名
      返回:
      字段长度
      抛出:
      SQLException - 数据库操作异常
    • getEntity

      EntityVO getEntity(String tableName) throws SQLException
      根据表名获取实体信息
      参数:
      tableName - 表名
      返回:
      实体信息对象
      抛出:
      SQLException - 数据库操作异常
    • getEntities

      List<EntityVO> getEntities() throws SQLException
      获取所有实体信息列表
      返回:
      实体信息对象列表
      抛出:
      SQLException - 数据库操作异常
    • getEntityNames

      List<String> getEntityNames() throws SQLException
      获取所有实体名称列表
      返回:
      实体名称列表
      抛出:
      SQLException - 数据库操作异常
    • isEqualsProperty

      boolean isEqualsProperty(PropertyVO propertyVO) throws SQLException
      判断字段属性是否相等
      参数:
      propertyVO - 字段属性信息对象
      返回:
      如果属性相等返回true,否则返回false
      抛出:
      SQLException - 数据库操作异常
    • createUnique

      String createUnique(EntityVO entityVO)
      为实体创建唯一约束
      参数:
      entityVO - 实体信息对象
      返回:
      创建唯一约束的SQL语句
    • dropUnique

      String dropUnique(EntityVO entityVO)
      删除实体的唯一约束
      参数:
      entityVO - 实体信息对象
      返回:
      删除唯一约束的SQL语句
    • alterField

      String alterField(PropertyVO propertyVO) throws SQLException
      修改字段属性
      参数:
      propertyVO - 字段属性信息对象
      返回:
      修改字段的SQL语句
      抛出:
      SQLException - 数据库操作异常
    • saveTable

      String saveTable(EntityVO entityVO) throws SQLException
      保存表结构信息
      参数:
      entityVO - 实体信息对象
      返回:
      保存操作的SQL语句
      抛出:
      SQLException - 数据库操作异常