spring-data-redis 序列化 Integer Long类型转换异常


redis使用Jackson2JsonRedisSerializer序列化问题

https://blog.csdn.net/weixin_33881041/article/details/91472219

解决方法

https://blog.csdn.net/qq_31445987/article/details/82260899

ZSetOperations zSetOperations = redisTemplate.opsForZSet();
Set<Object> idsSet = zSetOperations.reverseRange("xxxxx", 0L, -1L);
List<Long> ids = new ArrayList<>();
idsSet.forEach(e -> ids.add(e instanceof Integer ? ((Integer) e).longValue() : (Long) e));


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM