新家db.meta的索引相关接口

This commit is contained in:
huzhongying
2022-03-08 11:37:29 +08:00
parent 01af68cd0d
commit f769863ed7
6 changed files with 205 additions and 9 deletions

View File

@@ -1,11 +1,7 @@
package cn.hutool.db.meta;
import java.io.Serializable;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.*;
/**
* 数据库表信息
@@ -35,6 +31,11 @@ public class Table implements Serializable, Cloneable {
* 主键字段名列表
*/
private Set<String> pkNames = new LinkedHashSet<>();
/**
* 索引信息
*/
private List<IndexInfo> indexInfoList;
private final Map<String, Column> columns = new LinkedHashMap<>();
public static Table create(String tableName) {
@@ -209,4 +210,16 @@ public class Table implements Serializable, Cloneable {
this.pkNames.add(pkColumnName);
return this;
}
/**
* 获取索引信息
* @return 索引信息
*/
public List<IndexInfo> getIndexInfoList() {
return indexInfoList;
}
public void setIndexInfoList(List<IndexInfo> indexInfoList) {
this.indexInfoList = indexInfoList;
}
}