public interface ITableOperator extends IDbType
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addColumn(String tableName,
Column column)
在表中添加列。
|
void |
addForeignKey(String pkTableName,
String fkTableName,
String pkField,
String fkField)
添加外键
|
void |
createPartition(String tableName,
String partition)
创建分区。
|
void |
createTable(Table table)
根据Tble创建表。
|
void |
dropForeignKey(String tableName,
String keyName)
删除外键
|
void |
dropTable(String tableName)
根据表名删除表。
|
String |
getColumnType(Column column)
获取字段类型
|
String |
getColumnType(String columnType,
int charLen,
int intLen,
int decimalLen)
获取字段类型
|
Map<String,List<String>> |
getPKColumns(List<String> tableNames)
根据表名列表,取得相应的主键的列列表的Map。
|
List<String> |
getPKColumns(String tableName)
根据表名,取得相应的主键的列表
|
boolean |
isExsitPartition(String tableName,
String partition)
判断指定表的分区是否存在。
|
boolean |
isTableExist(String tableName)
判断表是否存在。
|
boolean |
supportPartition(String tableName)
是否支持分区。
|
void |
updateColumn(String tableName,
String columnName,
Column column)
更新列。
|
void |
updateTableComment(String tableName,
String comment)
修改表的注释
|
setDialect, setJdbcTemplateString getColumnType(String columnType, int charLen, int intLen, int decimalLen)
columnType - 字段类型charLen - 字符串长度intLen - 整型长度decimalLen - 小数长度void createTable(Table table) throws SQLException
table - 表SQLExceptionvoid dropTable(String tableName) throws SQLException
tableName - SQLExceptionvoid updateTableComment(String tableName, String comment) throws SQLException
tableName - 表名comment - 表注释SQLExceptionvoid addColumn(String tableName, Column column) throws SQLException
tableName - 表名column - 字段SQLExceptionvoid updateColumn(String tableName, String columnName, Column column) throws SQLException
tableName - 表名columnName - 列名column - 字段SQLExceptionvoid addForeignKey(String pkTableName, String fkTableName, String pkField, String fkField)
pkTableName - 主键表fkTableName - 外键表pkField - 主键fkField - 外键List<String> getPKColumns(String tableName) throws SQLException
tableName - 表名SQLExceptionMap<String,List<String>> getPKColumns(List<String> tableNames) throws SQLException
tableNames - 表名列表SQLExceptionboolean isTableExist(String tableName)
tableName - boolean isExsitPartition(String tableName, String partition)
tableName - partition - void createPartition(String tableName, String partition)
tableName - partition - boolean supportPartition(String tableName)
tableName - Copyright © 2018. All rights reserved.