mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
修复在某些极端的情况下,由于 MappedStatement 缓存造成的类型转换异常的问题
This commit is contained in:
parent
dd60479c4c
commit
6d452b0c06
@ -54,7 +54,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class FlexConfiguration extends Configuration {
|
||||
|
||||
private static Map<Class<?>, MappedStatement> dynamicMappedStatementCache = new ConcurrentHashMap<>();
|
||||
private static Map<String, MappedStatement> dynamicMappedStatementCache = new ConcurrentHashMap<>();
|
||||
|
||||
public FlexConfiguration(Environment environment) {
|
||||
super(environment);
|
||||
@ -150,7 +150,7 @@ public class FlexConfiguration extends Configuration {
|
||||
//动态 resultsMap,方法名称为:selectListByQuery
|
||||
Class<?> asType = MappedStatementTypes.getCurrentType();
|
||||
if (asType != null) {
|
||||
return MapUtil.computeIfAbsent(dynamicMappedStatementCache, asType,
|
||||
return MapUtil.computeIfAbsent(dynamicMappedStatementCache, id + ":" + asType.getName(),
|
||||
aClass -> replaceResultMap(ms, TableInfoFactory.ofEntityClass(asType))
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user