SpringBoot理论
SpringBoot是Spring框架的快速开发版本,降低了开发者在Spring框架下的开发成本,但并没有增强Spring的功能。SpringBoot核心功能
1. 起步依赖
也就是各种springboot与其他框架整合出的starter<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${mybatis.version}</version>
</dependency>
spring-boot-starter-web说明springboot内置了tomcat容器,spring-boot-starter-web让springboot的启动主方法可以用@MapperScan快速扫描到mapper的位置,同时也加入了大量JPA注解,如@Select、@Insert、@Update、@Delete等。
MyBatis官网B对mybatis-spring-boot-starter的说明:http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/
What is MyBatis-Spring-Boot-Starter?
The MyBatis-Spring-Boot-Starter help you build quickly MyBatis applications on top of the Spring Boot.By using this module you will achieve:
(1) Build standalone applications.
(2) Reduce the boilerplate to almost zero.
(3) Less XML configuration.