Example usage for org.springframework.data.redis.core RedisTemplate multi

List of usage examples for org.springframework.data.redis.core RedisTemplate multi

Introduction

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

Prototype

@Override
    public void multi() 

Source Link

Usage

From source file:org.shareok.data.redis.UserDaoImpl.java

@Transactional
public void test2() {
    RedisTemplate<String, Object> redis = new RedisTemplate<>();
    redis.setConnectionFactory(connectionFactory);
    //        redis.setKeySerializer(ApplicationConfig.StringSerializer.INSTANCE);
    //        redis.setValueSerializer(new JacksonJsonRedisSerializer<User>(UserDaoImpl.class));
    redis.afterPropertiesSet();//w w  w. ja  v a  2 s. c o  m
    redis.setEnableTransactionSupport(true);//???redistemplate?
    redis.multi();
    redis.boundValueOps("somevkey").increment(1);
    redis.boundZSetOps("somezkey").add("zvalue", 11);
    redis.exec();
    redis.setEnableTransactionSupport(false);
}