![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
文章平均质量分 55
辉度
这个作者很懒,什么都没留下…
展开
-
Mybatis Mapper Bean 生成源码分析二
Mybatis Mapper Bean 生成源码分析二 问题 在java程序中,我们往往一个@Autowired注解就可以获取到一个Mapper接口实例,一个未经我们实现的接口实例,那么这个Bean实例是怎么在Spring初始化的过程中注入的呢? 让我们来找找答案。 探寻内容偏长,没有DEBUG过且不耐烦可直接跳过去看总结~ MapperFactoryBean创建工厂 public T getObject() throws Exception { // getSqlSession() 即 SqlSessi原创 2021-09-12 16:01:54 · 237 阅读 · 0 评论 -
Mybatis Mapper Bean 生成源码分析一
Mybatis Mapper Bean 生成源码分析一 问题 我们的Mapper接口,用的是@Mapper,而非@Service等会被Spring扫描的注解,那么它最后怎么会生成一个Bean呢。 重点方法一:ClassPathMapperScanner#doScan org.mybatis.spring.mapper.ClassPathMapperScanner继承自org.springframework.context.annotation.ClassPathBeanDefinitionScanner,重原创 2021-09-12 15:59:52 · 284 阅读 · 0 评论