摘要: maven项目resources文件夹下log4j.properties 其作用是输出controller包下参与Mybatis的类的SQL语句输出。如果包名不一样,请根据自己的项目情况调整。 mybatis-config.xml文件添加 <setting name="logImpl" value= 阅读全文
posted @ 2017-08-23 15:32 Junsept 阅读(545) 评论(0) 推荐(0) 编辑
摘要: 正如大多数持久层框架一样,MyBatis 同样提供了一级缓存和二级缓存的支持 Mybatis二级缓存是SessionFactory,如果两次查询基于同一个SessionFactory,那么就从二级缓存中取数据,而不用到数据库里去取了。 1. 一级缓存: 基于PerpetualCache 的 Hash 阅读全文
posted @ 2017-08-23 15:20 Junsept 阅读(1688) 评论(0) 推荐(0) 编辑