@Test public void testSet() { ValueOperations<String, String> valueops = stringRedisTemplate.opsForValue(); valueops.set("name", "liuboTemplate"); System.err.println("set name"); }
public String add(User user) { String sid = new SessionToolUtil().generateSessionId(); ValueOperations<String, User> valueops = redisTemplate.opsForValue(); valueops.set(sid, user); return sid; }
public void set(Object key, Object value, Long expire) { operations.set(key, value, expire, TimeUnit.SECONDS); }
public void set(Object key, Object value) { operations.set(key, value); }
public void set(final CodisCacheKey cacheKey, final Object value) { String key = cacheKey.ganerateKey(); this.addIndex(cacheKey.ganerateGroup(), key); operations.set(key, value, cacheKey.getExpiration(), TimeUnit.SECONDS); }
private void setUserCache(String appId, String sessionToken, BaasUser user) { ValueOperations<String, String> ops = redisTemplate.opsForValue(); ops.set( "App_" + appId + USER_CLASS_NAME + "_" + sessionToken, jsonUtil.writeValueAsString(user)); }
// String数据类型 存储一对键值并设置有效时间 支持value为非String类型 public void set(String key, Serializable value, long timeout, TimeUnit unit) { valueOps = redisTemplate.opsForValue(); valueOps.set(key, value, timeout, unit); }
// String数据类型 存储一对键值 支持value为非String类型 public void set(String key, Serializable value) { valueOps = redisTemplate.opsForValue(); valueOps.set(key, value); }