소스 검색

兼容json序列化.

https://github.com/baomidou/mybatis-plus/issues/1956
nieqiuqiu 5 년 전
부모
커밋
269ae9c8b7
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisCachingExecutor.java

+ 2 - 3
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/executor/MybatisCachingExecutor.java

@@ -138,12 +138,11 @@ public class MybatisCachingExecutor implements Executor {
                         return (List<E>) result;
                     }
                 } else {
-                    Long count;
                     if (page != null) {
                         if (page.isSearchCount()) {
                             CacheKey cacheKey = getCountCacheKey(ms, boundSql, parameterObject, RowBounds.DEFAULT);
-                            count = (Long) tcm.getObject(cache, cacheKey);
-                            return new PageList((List) result, count);
+                            Number count = (Number) tcm.getObject(cache, cacheKey);
+                            return new PageList((List) result, count.longValue());
                         }
                         return new PageList((List) result, 0L);
                     } else {