Browse Source

支援Ipage的子类作为返回值

miemie 6 years ago
parent
commit
c2a18690b0

+ 3 - 7
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/MybatisMapperAnnotationBuilder.java

@@ -444,19 +444,15 @@ public class MybatisMapperAnnotationBuilder extends MapperAnnotationBuilder {
                     returnType = (Class<?>) returnTypeParameter;
                 }
             }
-            /*
-             * 新加入下面 7 行
-             */
-            else if (IPage.class.equals(rawType)) {
+            // TODO 下面是支援 IPage 及其子类作为返回值的
+            else if (IPage.class.isAssignableFrom(rawType)) {
                 Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
                 Type returnTypeParameter = actualTypeArguments[0];
                 if (returnTypeParameter instanceof Class<?>) {
                     returnType = (Class<?>) returnTypeParameter;
                 }
             }
-            /*
-             * 新加入上面 7 行
-             */
+            // TODO 上面是支援 IPage 及其子类作为返回值的
         }
 
         return returnType;