fix: selectListByQueryAs 使用实体类对象导致查询不出来数据。

This commit is contained in:
Suomm 2023-06-13 09:49:46 +08:00
parent 6f30da2821
commit 5ab7a9e481

View File

@ -209,20 +209,19 @@ public class FlexConfiguration extends Configuration {
addResultMap(resultMap);
}
}
/*
* 这里解释一下为什么要反转这个集合
*
* MyBatis 在解析 ResultMaps 的时候是按照顺序一个一个进行解析的对于有嵌套
* ResultMap 对象也就是 nestResultMap 需要放在靠前的位置首先解析
*
* 而我们进行递归 buildResultMapList 是非嵌套 ResultMap 在集合最开始的位置
* 所以要反转一下集合 hasNestedResultMaps ResultMap 对象放到集合的最
* 前面
*/
Collections.reverse(resultMapList);
}
/*
* 这里解释一下为什么要反转这个集合
*
* MyBatis 在解析 ResultMaps 的时候是按照顺序一个一个进行解析的对于有嵌套
* ResultMap 对象也就是 nestResultMap 需要放在靠前的位置首先解析
*
* 而我们进行递归 buildResultMapList 也好fillResultMapList 也好都是
* 非嵌套 ResultMap 在集合最开始的位置所以要反转一下集合 hasNestedResultMaps
* ResultMap 对象放到集合的最前面
*/
Collections.reverse(resultMapList);
return new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), ms.getSqlSource(), ms.getSqlCommandType())
.resource(ms.getResource())
.fetchSize(ms.getFetchSize())