Beispiel #1
0
  @Test
  public void testGet() {

    ValueOperations<String, String> valueops = stringRedisTemplate.opsForValue();
    String name = valueops.get("name");
    System.err.println("get name = " + name);
  }
 public Object get(Object key) {
   return operations.get(key);
 }
 public Object get(final CodisCacheKey cacheKey) {
   return operations.get(cacheKey.ganerateKey());
 }
 private BaasUser getUserCache(String appId, String sessionToken) {
   ValueOperations<String, String> ops = redisTemplate.opsForValue();
   String userStr = ops.get("App_" + appId + USER_CLASS_NAME + "_" + sessionToken);
   return jsonUtil.readValue(userStr, BaasUser.class);
 }
  public User get(String id) {

    ValueOperations<String, User> valueops = redisTemplate.opsForValue();
    User user = valueops.get(id);
    return user;
  }
 /**
  * String数据类型 读取键为key的值 支持value非String类型
  *
  * @param key
  * @return value值
  */
 public Serializable get(String key) {
   valueOps = redisTemplate.opsForValue();
   return valueOps.get(key);
 }