Memcache仅仅支持简单数据类型 ,复杂数据类型需要应用自己处理

 

从数据库当中取出数据[User [id=1, username=guowuxin, password=guowuxin], User [id=2, username=guoxiaoming, password=guowuxin]]
从Cache当中取出数据[]

final String getAllListmd5 = Md5.md5("select * from user");
// 将集合对象存入缓存中
cache.add(getAllListmd5, userList);
//memcache仅仅支持简单数据类型,复杂数据类型需要应用处理
final List<User> cacheData = (List<User>)cache.get(getAllListmd5);
System.out.println("从Cache当中取出数据" + cacheData);

 取出的内容将无法转换成数据

相关文章:

  • 2021-12-14
  • 2021-10-03
  • 2022-12-23
  • 2021-11-11
  • 2021-08-12
  • 2021-05-28
  • 2022-12-23
猜你喜欢
  • 2021-11-25
  • 2021-07-23
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2021-10-11
  • 2021-10-22
相关资源
相似解决方案