mybatis-spring源码分析
2023-02-28 09:15:00 0 举报
mybatis-spring源码分析
作者其他创作
大纲/内容
MapperProxyFactory代理Mapper方法,调用mybatis的Excutor执行sql
@MapperScan
继承了SqlSessionDaoSupport,SqlSessionDaoSupport实现了InitializingBean 初始化调用checkDaoConfig
public class MapperScannerConfigurer span style=\"font-size: inherit;\
MapperAnnotationBuilder构建动态sql
postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry)
type.getMethods()获取当前mapper接口类的所有方法
构建扫描器
BeanDefinitionBuilder构建font color=\"#e74f4c\
ImportBeanDefinitionRegistrar
MapperScannerRegistrar
BeanDefinitionRegistryPostProcessor接口实现
configuration.addMapper(this.mapperInterface);
更改扫描之后的所有Bean定义:MapperFactoryBean.classMapperFactoryBeanprivate Class<T> mapperInterface
ClassPathMapperScanner扫描器1. registerFilters2.scan
parse方法
@Import(MapperScannerRegistrar.class)
registerBeanDefinitions(font color=\"#ec7270\
1. super.doScan() -> Set<BeanDefinitionHolder>2. processBeanDefinitions
0 条评论
下一页