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

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

Introduction

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

Prototype

@Nullable
Long hDel(byte[] key, byte[]... fields);

Source Link

Document

Delete given hash fields .

Usage

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

public void delete(K key, Object... hashKeys) {
    final byte[] rawKey = rawKey(key);
    final byte[][] rawHashKeys = rawHashKeys(hashKeys);

    execute(new RedisCallback<Object>() {

        public Object doInRedis(RedisConnection connection) {
            connection.select(dbIndex);/*from  w  w  w .j a v a  2  s  . co  m*/
            connection.hDel(rawKey, rawHashKeys);
            return null;
        }
    }, true);
}

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

/**
 * Delete given hash {@code fields}./*from  ww w .j av a2  s  .  c  om*/
 * 
 * @see http://redis.io/commands/hdel
 * @param key key
 * @param fields fields
 * @return Long
 */
public static Long hDel(byte[] key, byte[]... fields) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.hDel(key, fields);
        }
    });
}

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

/**
 * Delete given hash {@code fields}.//w w  w .  j a va 2s  . com
 * 
 * @see http://redis.io/commands/hdel
 * @param key key
 * @param fields fields
 * @return Long
 */
public Long hDel(byte[] key, byte[]... fields) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.hDel(key, fields);
        }
    });
}