当前的映射文件支持二级缓存(在xxx.xml中配置)
让当前的操作支持二级缓存(在select标签中配置)
<settings> <setting "cacheEnabled"value="true"/></settings>
在mapper.xml中加入标签<cache/>核心参数可不设置,使用默认参数。开启本mapper下的namespace的二级缓存,默认使用的是mybatis提供的PerpetualCache。
mapper.xml
<cache/>
mapper
namespace
mybatis
PerpetualCache