Example usage for org.springframework.data.redis.connection RedisConnection hGetAll

List of usage examples for org.springframework.data.redis.connection RedisConnection hGetAll

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection hGetAll.

Prototype

@Nullable
Map<byte[], byte[]> hGetAll(byte[] key);

Source Link

Document

Get entire hash stored at key .

Usage

From source file:com.mauersu.util.redis.DefaultHashOperations.java

public Map<HK, HV> entries(K key) {
    final byte[] rawKey = rawKey(key);

    Map<byte[], byte[]> entries = execute(new RedisCallback<Map<byte[], byte[]>>() {

        public Map<byte[], byte[]> doInRedis(RedisConnection connection) {
            connection.select(dbIndex);//from   w w  w  .ja  va 2s  . c  om
            return connection.hGetAll(rawKey);
        }
    }, true);

    return deserializeHashMap(entries);
}

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Get entire hash stored at {@code key}.
 * /*from ww  w.java2s  . co m*/
 * @see http://redis.io/commands/hgetall
 * @param key key
 * @return Map
 */
public static Map<byte[], byte[]> hGetAll(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Map<byte[], byte[]>>() {
        @Override
        public Map<byte[], byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.hGetAll(key);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Get entire hash stored at {@code key}.
 * /*  ww w  . j a  v a2  s  . c  o  m*/
 * @see http://redis.io/commands/hgetall
 * @param key key
 * @return Map
 */
public Map<byte[], byte[]> hGetAll(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Map<byte[], byte[]>>() {
        @Override
        public Map<byte[], byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.hGetAll(key);
        }
    });
}