fix 修复 代码生成 表结构缓存问题

This commit is contained in:
疯狂的狮子Li 2024-07-27 14:22:57 +08:00
parent 19fd562c24
commit 9825f349ac

View File

@ -186,7 +186,7 @@ public class GenTableServiceImpl implements IGenTableService {
@Override @Override
public List<GenTable> selectDbTableListByNames(String[] tableNames, String dataName) { public List<GenTable> selectDbTableListByNames(String[] tableNames, String dataName) {
Set<String> tableNameSet = new HashSet<>(List.of(tableNames)); Set<String> tableNameSet = new HashSet<>(List.of(tableNames));
LinkedHashMap<String, Table<?>> tablesMap = ServiceProxy.metadata().tables(); LinkedHashMap<String, Table<?>> tablesMap = ServiceProxy.service(dataName).metadata().tables();
if (CollUtil.isEmpty(tablesMap)) { if (CollUtil.isEmpty(tablesMap)) {
return new ArrayList<>(); return new ArrayList<>();
@ -294,11 +294,9 @@ public class GenTableServiceImpl implements IGenTableService {
*/ */
@DS("#dataName") @DS("#dataName")
private List<GenTableColumn> selectDbTableColumnsByName(String tableName, String dataName) { private List<GenTableColumn> selectDbTableColumnsByName(String tableName, String dataName) {
Table<?> table = ServiceProxy.metadata().table(tableName); // 清理anyline缓存
if (Objects.isNull(table)) { CacheProxy.clear();
return new ArrayList<>(); LinkedHashMap<String, Column> columns = ServiceProxy.metadata().columns(tableName);
}
LinkedHashMap<String, Column> columns = table.getColumns();
List<GenTableColumn> tableColumns = new ArrayList<>(); List<GenTableColumn> tableColumns = new ArrayList<>();
columns.forEach((columnName, column) -> { columns.forEach((columnName, column) -> {
GenTableColumn tableColumn = new GenTableColumn(); GenTableColumn tableColumn = new GenTableColumn();