【mybatis源码学习】与spring整合Mapper接口执行原理

一、重要的接口

org.mybatis.spring.mapper.MapperFactoryBean

MapperScannerConfigurer会向spring中注册该bean,一个mapper接口注册一个

该类是生产MapperProxy对象

org.apache.ibatis.binding.MapperProxy

mapper接口的代理类

org.mybatis.spring.SqlSessionInterceptor

sqlSession的动态代理类

org.mybatis.spring.mapper.MapperScannerConfigurer

生成Mapper接口代理类的注册器

该类是spring的org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor接口实现

该类依赖:mapper接口的包名+sqlSessionFactory



二、实现原理

猜你喜欢

转载自www.cnblogs.com/shangxiaofei/p/10837751.html