diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexConfiguration.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexConfiguration.java index 430656c2..c86c181c 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexConfiguration.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/FlexConfiguration.java @@ -143,7 +143,8 @@ public class FlexConfiguration extends Configuration { MappedStatement ms = super.getMappedStatement(id); //动态 resultsMap,方法名称为:selectListByQuery Class asType = MappedStatementTypes.getCurrentType(); - if (asType != null) { + //忽略掉查询 Rows 的方法 + if (asType != null && !id.endsWith("selectRowsByQuery")) { return MapUtil.computeIfAbsent(dynamicMappedStatementCache, id + ":" + asType.getName(), clazz -> replaceResultMap(ms, TableInfoFactory.ofEntityClass(asType)) ); diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/RelationManager.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/RelationManager.java index 3ea7f698..6cd48517 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/RelationManager.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/relation/RelationManager.java @@ -356,7 +356,7 @@ public class RelationManager { queryWrapper.where(column(relation.getJoinSelfColumn()).eq(selfFieldValues.iterator().next())); } - mappingRows = mapper.selectListByQueryAs(queryWrapper, Row.class); + mappingRows = mapper.selectRowsByQuery(queryWrapper); if (CollectionUtil.isEmpty(mappingRows)) { return; }