【redis】spring boot中 使用redis hash 操作
标签:operation ash tostring string lse ons equals etc dea
示例:
@Autowired
StringRedisTemplate redisTemplate;
@Override
public void dealRedis(Dealer dealer) {
dealer = dao.findByUid(dealer.getUid());
String tid = dealer.getTenementId();
HashOperations ofh = redisTemplate.opsForHash();
Field[] declaredFields = dealer.getClass().getDeclaredFields();
for (Field declaredField : declaredFields) {
String name = declaredField.getName();
if (name.equals("id") || name.equals("tid")){
continue;
}else {
ofh.increment(tid,name,111);
}
}
Map
结果:
【redis】spring boot中 使用redis hash 操作
标签:operation ash tostring string lse ons equals etc dea
原文地址:https://www.cnblogs.com/sxdcgaq8080/p/9562633.html
评论