mybatis13---2级缓存
摘要:验证内置的2级缓存 Ehcache缓存的配置 01.引入需要的ehcache 和mybatis-ehcache 两个jar包 02.在mapper文件中增加 <cache type="org.mybatis.caches.ehcache.EhcacheCache"/> <!-- 配置Ehcache缓
阅读全文
posted @
2017-09-17 11:15
末
阅读(225)
推荐(0)
mybatis12一级缓存
摘要:验证一级缓存的存在 对应的实体类 对应的数据库--student表 创建对应的dao 对应的mapper文件 对应的测试类代码 查询语句的结果是: 只有一条查询结果! 验证mybatis缓存查询的依据! 在dao中增加一个方法 修改mapper文件 增加测试代码 修改log4j配置文件 查询的结果是
阅读全文
posted @
2017-09-17 10:24
末
阅读(237)
推荐(0)
Mybatis中#和$的区别
摘要:01.$ 不安全 底层实现是Statement对象 select * from student where id=${id} 如果我们id传入的是11 编译之后 select * from student where id=11 # 安全 底层实现是PreparedStatement对象 selec
阅读全文
posted @
2017-09-16 00:07
末
阅读(298)
推荐(0)
MyBatis动态代理查询出错
摘要:org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Error instant
阅读全文
posted @
2017-09-15 16:33
末
阅读(379)
推荐(0)