41
41
import org .anyline .metadata .Column ;
42
42
import org .anyline .metadata .Database ;
43
43
import org .anyline .metadata .Table ;
44
+ import org .anyline .proxy .CacheProxy ;
44
45
import org .anyline .proxy .ServiceProxy ;
45
46
import org .anyline .service .AnylineService ;
46
47
import org .jetbrains .annotations .NotNull ;
@@ -96,6 +97,7 @@ public String queryTableDdl(String dsName, String tableName) throws Exception {
96
97
public List <String > queryTableColumn (String dsName , String tableName ) {
97
98
// 手动切换数据源
98
99
DynamicDataSourceContextHolder .push (dsName );
100
+ CacheProxy .clear ();
99
101
return ServiceProxy .metadata ().columns (tableName ).values ().stream ().map (Column ::getName ).toList ();
100
102
}
101
103
@@ -109,6 +111,7 @@ public List<String> queryTableColumn(String dsName, String tableName) {
109
111
public IPage queryTablePage (Page <Table > page , GenTable table ) {
110
112
// 手动切换数据源
111
113
DynamicDataSourceContextHolder .push (table .getDsName ());
114
+ CacheProxy .clear ();
112
115
List <Table > tableList = ServiceProxy .metadata ().tables ().values ().stream ().filter (t -> {
113
116
if (StrUtil .isBlank (table .getTableName ())) {
114
117
return true ;
@@ -132,6 +135,7 @@ public IPage queryTablePage(Page<Table> page, GenTable table) {
132
135
public List <String > queryTableList (String dsName ) {
133
136
// 手动切换数据源
134
137
DynamicDataSourceContextHolder .push (dsName );
138
+ CacheProxy .clear ();
135
139
return ServiceProxy .metadata ().tables ().values ().stream ().map (Table ::getName ).toList ();
136
140
}
137
141
@@ -170,6 +174,7 @@ protected GenTable tableImport(String dsName, String tableName) {
170
174
// 查询表是否存在
171
175
GenTable table = new GenTable ();
172
176
// 从数据库获取表信息
177
+ CacheProxy .clear ();
173
178
AnylineService service = ServiceProxy .service ();
174
179
Table tableMetadata = service .metadata ().table (tableName );
175
180
Database database = service .metadata ().database ();
0 commit comments