From d6ff291a3bd7f5b3ec77572bfe4d679f25be5a66 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Wed, 14 Jun 2023 19:40:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20https://gitee.com/mybatis-flex/mybatis-f?= =?UTF-8?q?lex/issues/I7DJ7B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mybatisflex/core/table/TableInfoFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfoFactory.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfoFactory.java index 2173bf9d..64a54e99 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfoFactory.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/table/TableInfoFactory.java @@ -25,6 +25,7 @@ import com.mybatisflex.core.util.CollectionUtil; import com.mybatisflex.core.util.StringUtil; import org.apache.ibatis.io.ResolverUtil; import org.apache.ibatis.reflection.Reflector; +import org.apache.ibatis.reflection.TypeParameterResolver; import org.apache.ibatis.session.Configuration; import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.TypeHandler; @@ -216,7 +217,7 @@ public class TableInfoFactory { ) { // 集合嵌套 if (Collection.class.isAssignableFrom(fieldType)) { - Type genericType = field.getGenericType(); + Type genericType = TypeParameterResolver.resolveFieldType(field, entityClass); if (genericType instanceof ParameterizedType){ Class actualTypeArgument = (Class) ((ParameterizedType) genericType).getActualTypeArguments()[0]; //需排除 List List 等场景