Spring boot + Mybatis plus + Red
2019-07-04 本文已影响509人
从入门到暴毙
1.本文主要讲解基于Spring boot + Mybatis plus + Redis实现二级缓存
1.1 通过application.yml配置redis的连接信息,springboot默认redis用的lecttuce客户端,如果想用jedis的话,只需要在pom.xml中引入redis的时候排除在lecttuce,然后再导入jedis的jar包就好了,

1.2 打开mybatis plus的二级缓存,为true的时候是开启的,false是关闭二级缓存

1.3 编写缓存类继承Cache类,实现Cache中的方法



1.4 早*.xml中加上<cache>标签,type写你所编写二级缓存类的路径
