fixed:不支持自己扩展 mapper 的问题;close #I6ZTS3

This commit is contained in:
开源海哥 2023-05-03 09:13:52 +08:00
parent 2116dff818
commit 63caa4bf7f

View File

@ -94,16 +94,17 @@ public class TableInfoFactory {
private static Class<?> getEntityClass(Class<?> mapperClass) {
if (mapperClass == null) {
throw new NullPointerException("mapperClass can not be null.");
}
Type[] genericInterfaces = mapperClass.getGenericInterfaces();
if (genericInterfaces.length == 1) {
Type type = genericInterfaces[0];
if (type instanceof ParameterizedType) {
return (Class<?>) ((ParameterizedType) type).getActualTypeArguments()[0];
} else {
return getEntityClass((Class<?>) type);
}
}
return null;
return getEntityClass(mapperClass.getSuperclass());
}