Mybatis--->缓存

1、开启缓存(二级缓存)

<settings>
        <setting name="logImpl" value="LOG4J"/>
        <setting name="cacheEnabled" value="true"/>
</settings>

2、对应Mapper中只需添加一步

   <cache />

完成

缓存适用于不经常修改的SELECT语句

其他语句没有缓存可用

原文地址:https://www.cnblogs.com/springxian/p/13532129.html