赞
踩
新建一个对象存入redis中,对象中会出现一个字段@type
Value value = new Value()
redisTemplate.opsForValue().set(key, value)
如下图
取数据时如果Value对象的包与存入时的包路径不一致,会报错java.lang.ClassCastException: com.alibaba.fastjson.JSONObject cannot be cast to
redisTemplate.opsForValue().get(key);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。