springboot的运行机制 ?
从springbootapplication 说起 ,
进入以后包含三个注解
1 @SpringBootConfiguration
其实就是spring 中的 configuration 注解 用来声明一个类是配置类
2 @ComponentScan
同样也是spirng的
将指定包下需要装配的组件注册到容器中去
3.@EnableAutoConfiguration
然而总结
:springboot 根据配置文件自动装配所属依赖的类,
再用动态代理的方式,注入到spring容器中
二 、 mybatis 的二级缓存怎么开启?
在mybatis 的配置文件中开启二级缓存并且在mapper.xml 文件中打上cache 标签就可以了