List of usage examples for org.springframework.data.redis.connection RedisConnection hSet
@Nullable Boolean hSet(byte[] key, byte[] field, byte[] value);
From source file:com.mauersu.util.redis.DefaultHashOperations.java
public void put(K key, HK hashKey, HV value) { final byte[] rawKey = rawKey(key); final byte[] rawHashKey = rawHashKey(hashKey); final byte[] rawHashValue = rawHashValue(value); execute(new RedisCallback<Object>() { public Object doInRedis(RedisConnection connection) { connection.select(dbIndex);//from w w w. java 2s . c om connection.hSet(rawKey, rawHashKey, rawHashValue); return null; } }, true); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Set the {@code value} of a hash {@code field}. * //from ww w . j a va2 s. co m * @see http://redis.io/commands/hset * @param key key * @param field field * @param value value * @return Boolean */ public static Boolean hSet(byte[] key, byte[] field, byte[] value) { return redisTemplate.execute(new RedisCallback<Boolean>() { @Override public Boolean doInRedis(RedisConnection redis) throws DataAccessException { return redis.hSet(key, field, value); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Set the {@code value} of a hash {@code field}. * /*ww w.j a va2 s . co m*/ * @see http://redis.io/commands/hset * @param key key * @param field field * @param value value * @return Boolean */ public Boolean hSet(byte[] key, byte[] field, byte[] value) { return redisTemplate.execute(new RedisCallback<Boolean>() { @Override public Boolean doInRedis(RedisConnection redis) throws DataAccessException { return redis.hSet(key, field, value); } }); }