Browse Source

兼容json序列化.

https://github.com/baomidou/mybatis-plus/issues/1956
nieqiuqiu 5 years ago
parent
commit
269ae9c8b7

+ 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 {