Example usage for org.springframework.data.redis.core HashOperations hasKey

List of usage examples for org.springframework.data.redis.core HashOperations hasKey

Introduction

In this page you can find the example usage for org.springframework.data.redis.core HashOperations hasKey.

Prototype

Boolean hasKey(H key, Object hashKey);

Source Link

Document

Determine if given hash hashKey exists.

Usage

From source file:com.easarrive.datasource.redis.etago.AbstractDaoByRedisTemplate.java

public V hashGet(K key, F feild) {
    HashOperations<K, F, V> hashOperations = redisTemplate.opsForHash();
    V object = null;//from w  ww  .ja  v a 2  s.  c om
    if (hashOperations.hasKey(key, feild)) {
        object = hashOperations.get(key, feild);
    }
    return object;
}

From source file:com.company.project.service.dao.RedisDao.java

public boolean hasKeyHash(String objectKey, String key) {
    HashOperations opsForHash = redisTemplate.opsForHash();
    return opsForHash.hasKey(objectKey, key);
}