Mybatis使用redis缓存(整合) 实现思路: 开启mybatis二级缓存 在mapper.xml中加入====单标签表示开启本地缓存 type属性:指定使用哪个cache(默认省略,使用的是org.apache.ibatis.cache.impl.PerpetualCache) Mybatis-cache实现 Cache接口PerpetualCache实现Cache接口并重写一大堆方法。 Mybatis-Redis缓存实现 自定义一个类实现Cache接口并重写相关方法。 使用RedisCache实现 <cache/ type=“xx.RedisCache”>