public static < K , V > RedisTemplate < K , V > newRedisTemplate ( final RedisConnectionFactory connectionFactory ) { val template = new RedisTemplate < K , V > ( ) ; val string = new StringRedisSerializer ( ) ; val jdk = new JdkSerializationRedisSerializer ( ) ; template . setKeySerializer ( string ) ; template . setValueSerializer ( jdk ) ; template . setHashValueSerializer ( jdk ) ; template . setHashKeySerializer ( string ) ; template . setConnectionFactory ( connectionFactory ) ; return template ; }
New redis template .