RedisTemplate类,是Spring-Data-Redis提供的操作Key-Value的类,使用参考代码如下:
public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
@SuppressWarnings("resource")
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
Hello hello = (Hello) context.getBean("hello");
hello.sayHello();
@SuppressWarnings("unchecked")
RedisTemplate<String, Serializable> redisTemplate = (RedisTem