mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
feat: add support nested types for MappedStatementTypes.java
This commit is contained in:
parent
3e72d5f22c
commit
b98acf0b47
@ -143,7 +143,8 @@ public class FlexConfiguration extends Configuration {
|
|||||||
MappedStatement ms = super.getMappedStatement(id);
|
MappedStatement ms = super.getMappedStatement(id);
|
||||||
//动态 resultsMap,方法名称为:selectListByQuery
|
//动态 resultsMap,方法名称为:selectListByQuery
|
||||||
Class<?> asType = MappedStatementTypes.getCurrentType();
|
Class<?> asType = MappedStatementTypes.getCurrentType();
|
||||||
if (asType != null) {
|
//忽略掉查询 Rows 的方法
|
||||||
|
if (asType != null && !id.endsWith("selectRowsByQuery")) {
|
||||||
return MapUtil.computeIfAbsent(dynamicMappedStatementCache, id + ":" + asType.getName(),
|
return MapUtil.computeIfAbsent(dynamicMappedStatementCache, id + ":" + asType.getName(),
|
||||||
clazz -> replaceResultMap(ms, TableInfoFactory.ofEntityClass(asType))
|
clazz -> replaceResultMap(ms, TableInfoFactory.ofEntityClass(asType))
|
||||||
);
|
);
|
||||||
|
|||||||
@ -356,7 +356,7 @@ public class RelationManager {
|
|||||||
queryWrapper.where(column(relation.getJoinSelfColumn()).eq(selfFieldValues.iterator().next()));
|
queryWrapper.where(column(relation.getJoinSelfColumn()).eq(selfFieldValues.iterator().next()));
|
||||||
}
|
}
|
||||||
|
|
||||||
mappingRows = mapper.selectListByQueryAs(queryWrapper, Row.class);
|
mappingRows = mapper.selectRowsByQuery(queryWrapper);
|
||||||
if (CollectionUtil.isEmpty(mappingRows)) {
|
if (CollectionUtil.isEmpty(mappingRows)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user