diff --git a/hsweb-easy-orm-rdb/src/main/java/org/hswebframework/ezorm/rdb/supports/commons/RDBTableMetadataParser.java b/hsweb-easy-orm-rdb/src/main/java/org/hswebframework/ezorm/rdb/supports/commons/RDBTableMetadataParser.java index 77ef6a12..17d9800c 100644 --- a/hsweb-easy-orm-rdb/src/main/java/org/hswebframework/ezorm/rdb/supports/commons/RDBTableMetadataParser.java +++ b/hsweb-easy-orm-rdb/src/main/java/org/hswebframework/ezorm/rdb/supports/commons/RDBTableMetadataParser.java @@ -81,6 +81,7 @@ protected Optional doParse(String name) { .stream() .map(record -> { RDBColumnMetadata column = metaData.newColumn(); + record.getString("table_name").ifPresent(metaData::setRealName); applyColumnInfo(column, record); return column; }) @@ -114,8 +115,9 @@ public Mono parseByNameReactive(String name) { ReactiveSqlExecutor reactiveSqlExecutor = getReactiveSqlExecutor(); //列 Mono> columns = reactiveSqlExecutor - .select(template(getTableMetaSql(null), param), new RecordResultWrapper()) + .select(template(getTableMetaSql(name), param), new RecordResultWrapper()) .map(record -> { + record.getString("table_name").ifPresent(metaData::setRealName); RDBColumnMetadata column = metaData.newColumn(); applyColumnInfo(column, record); metaData.addColumn(column); @@ -129,10 +131,11 @@ public Mono parseByNameReactive(String name) { .singleOrEmpty(); //加载索引 - Flux index = schema.findFeature(IndexMetadataParser.ID) - .map(parser -> parser.parseTableIndexReactive(name)) - .orElseGet(Flux::empty) - .doOnNext(metaData::addIndex); + Flux index = schema + .findFeature(IndexMetadataParser.ID) + .map(parser -> parser.parseTableIndexReactive(name)) + .orElseGet(Flux::empty) + .doOnNext(metaData::addIndex); return Flux .merge(columns, comments, index)