Java Code Examples for org.springframework.data.redis.core.RedisTemplate#opsForHash()

The following examples show how to use org.springframework.data.redis.core.RedisTemplate#opsForHash() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedisCache.java    From alcor with Apache License 2.0 5 votes vote down vote up
public RedisCache(RedisTemplate<K, V> redisTemplate, String name) {
    this.redisTemplate = redisTemplate;
    hashOperations = redisTemplate.opsForHash();
    this.name = name;

    transaction = new RedisTransaction(redisTemplate);
}
 
Example 2
Source File: RedisCache.java    From alcor with Apache License 2.0 5 votes vote down vote up
public RedisCache(RedisTemplate<K, V> redisTemplate, String name) {
    this.redisTemplate = redisTemplate;
    hashOperations = redisTemplate.opsForHash();
    this.name = name;

    transaction = new RedisTransaction(redisTemplate);
}
 
Example 3
Source File: RedisCache.java    From alcor with Apache License 2.0 5 votes vote down vote up
public RedisCache(RedisTemplate<K, V> redisTemplate, String name) {
    this.redisTemplate = redisTemplate;
    hashOperations = redisTemplate.opsForHash();
    this.name = name;

    transaction = new RedisTransaction(redisTemplate);
}
 
Example 4
Source File: PersonRepository.java    From bluemix-cloud-connectors with Apache License 2.0 4 votes vote down vote up
public PersonRepository(RedisTemplate<String, Person> redisTemplate) {
    this.hashOps = redisTemplate.opsForHash();
}
 
Example 5
Source File: RedisAlbumRepository.java    From spring-music with Apache License 2.0 4 votes vote down vote up
public RedisAlbumRepository(RedisTemplate<String, Album> redisTemplate) {
    this.hashOps = redisTemplate.opsForHash();
    this.idGenerator = new RandomIdGenerator();
}
 
Example 6
Source File: RedisConfig.java    From sophia_scaffolding with Apache License 2.0 2 votes vote down vote up
/**
 * 实例化 HashOperations 对象,可以使用 Hash 类型操作
 * @param redisTemplate
 * @return
 */
@Bean
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
    return redisTemplate.opsForHash();
}
 
Example 7
Source File: RedisConfig.java    From sophia_scaffolding with Apache License 2.0 2 votes vote down vote up
/**
 * 实例化 HashOperations 对象,可以使用 Hash 类型操作
 * @param redisTemplate
 * @return
 */
@Bean
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
    return redisTemplate.opsForHash();
}
 
Example 8
Source File: RedisConfig.java    From sophia_scaffolding with Apache License 2.0 2 votes vote down vote up
/**
 * 实例化 HashOperations 对象,可以使用 Hash 类型操作
 * @param redisTemplate
 * @return
 */
@Bean
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
    return redisTemplate.opsForHash();
}
 
Example 9
Source File: RedisCacheConfig.java    From agile-service-old with Apache License 2.0 2 votes vote down vote up
/**
 * 实例化 HashOperations 对象,可以使用 Hash 类型操作
 *
 * @param redisTemplate redisTemplate
 * @return HashOperations
 */
@Bean
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
    return redisTemplate.opsForHash();
}