相信读者能通过本文的学习,打下一定的 Spring 技能基础,为后面 Spring 生态的扩展技术做充足的准备。
本文大致包含了以下几方面的讲解:
- 通过 StudentMapper.xml 将类和表建立起映射关系;
- 将 studentService 及属性 studentMapper 注入 Spring IoC 容器,StudentService 接口及实现类 StudentServiceImpl 的实现过程;
- 通过 Spring 产生 MyBatis 最终操作需要的动态 Mapper 对象(StudentMapper 对象);
- 在 Spring IoC 容器中如何创建 MyBatis 的核心类 SqlSessionFactory,并将 Spring 配置的 SqlSessionFactory 对象交给Mapper(Dao 层)。