Springmvc 与 MyBatis的整合(三)mapper
整合service。
实现目标用spirng管理service接口
首先定义service接口
实现service接口,实现类为:ItemsServiceImpl 在实现类中通过@Autowired自动注入的方式,注入itemMapperCustom(映射器类和itemMapperCustom.xml对应在同一个类切名字一样)。
在spring容器中配置service
创建applicationContext-service.xml在这个文件中配置service接口
事务控制(applicationContext-trsaction.xml)