springboot+mybatis 配置缓存Ehcache

1.pom.xml
Ehcache和mybatis plus架包

2.ehcache.xml
resources文件夹下ehcache.xml文件
image

3.mappers.xml自定义缓存ehcache,添加查询方法
image

4.测试内置Service接口方法和自己添加的查询方法
image

5.测试结果,内置Service接口方法不走缓存,添加的查询方法,走缓存。
image


heart_pwx
1 声望0 粉丝

人生代代无穷已,江月年年望相似。