springboot
文章平均质量分 90
hhcui重名了
这个作者很懒,什么都没留下…
展开
-
spring和mybatis整合源码解析
springboot和mybatis整合源码解析使用的是我们springboot,所以我们先要创建一个config类@Configuration//指定这是一个核心配置类@MapperScan("com.demo.dao")//扫描dao层,生成动态代理@ComponentScan("com.demo")//扫描该路径下所有类上的注解@EnableTransactionManagement//开启事务@EnableAspectJAutoProxypublic class Application原创 2021-05-23 20:54:41 · 234 阅读 · 0 评论 -
Springboot如何实现自动装配
Springboot如何实现自动装配首先附上springboot启动的整理流程图,可以发现实现自动装配的主要是里面的两个流程prepareContext()和refreshContext()。下面就让我们进入这两个方法,去分析spring如何完成自动装配。prepareContext()prepareContext里面的核心方法是load(context, sources.toArray(new Object[0]));,sourcce就是我们的main函数所在的类。创建一个loader用于原创 2021-05-21 22:54:48 · 521 阅读 · 0 评论