摘要:
1、问题和思路 在测试类中,当我们需要使用spring容器进行方法测试的时候,总是需要写下面两句。因为这两行代码获取了容器对象,没有他们就会产生空指针异常 ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml"); 阅读全文
摘要:
1、Mybatis常用注解说明 2、Mybatis注解实现基本CRUD操作 实体类(这里故意设置为属性名和数据库列表名不一致) public class User implements Serializable { private Integer userId; private String use 阅读全文
摘要:
1、 一级缓存 1)一级缓存是SqlSession级别的缓存,只要SqlSession没有flush或者close,它就存在 2)证明一级缓存 User user = userDao.findById(41); System.out.println("第一次查询的用户:"+user); User u 阅读全文