org.springframework.data.redis.core.BoundHashOperations.values()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.springframework.data.redis.core.BoundHashOperations.values()方法的一些代码示例,展示了BoundHashOperations.values()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BoundHashOperations.values()方法的具体详情如下:
包路径:org.springframework.data.redis.core.BoundHashOperations
类名称:BoundHashOperations
方法名:values

BoundHashOperations.values介绍

[英]Get entry set (values) of hash at the bound key.
[中]获取绑定键处哈希的条目集(值)。

代码示例

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Collection<V> values() {
  return hashOps.values();
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public Collection<V> values() {
  return hashOps.values();
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Collection<V> values() {
  return hashOps.values();
}

代码示例来源:origin: TyCoding/springboot-seckill

@Override
public List<Seckill> findAll() {
  List<Seckill> seckillList = redisTemplate.boundHashOps("seckill").values();
  if (seckillList == null || seckillList.size() == 0){
    //说明缓存中没有秒杀列表数据
    //查询数据库中秒杀列表数据,并将列表数据循环放入redis缓存中
    seckillList = seckillMapper.findAll();
    for (Seckill seckill : seckillList){
      //将秒杀列表数据依次放入redis缓存中,key:秒杀表的ID值;value:秒杀商品数据
      redisTemplate.boundHashOps(key).put(seckill.getSeckillId(), seckill);
      logger.info("findAll -> 从数据库中读取放入缓存中");
    }
  }else{
    logger.info("findAll -> 从缓存中读取");
  }
  return seckillList;
}

相关文章