update 优化 代码生成器 pg数据库 主键获取不精确问题

This commit is contained in:
疯狂的狮子Li 2024-11-22 17:18:27 +08:00
parent ef919b9f3d
commit cd08f66c59

View File

@ -303,7 +303,11 @@ public class GenTableServiceImpl implements IGenTableService {
@DS("#dataName") @DS("#dataName")
@Override @Override
public List<GenTableColumn> selectDbTableColumnsByName(String tableName, String dataName) { public List<GenTableColumn> selectDbTableColumnsByName(String tableName, String dataName) {
LinkedHashMap<String, Column> columns = ServiceProxy.metadata().columns(tableName); Table<?> table = ServiceProxy.metadata().table(tableName);
if (ObjectUtil.isNull(table)) {
return new ArrayList<>();
}
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();