영속성 계층(자바 퍼시스턴스 프레임워크)에 속한다.
XML 서술자나 애너테이션을 이용하여 SQL문으로 객체를 연결시킨다.
SQL을 체계적으로 관리할 수 있다.
자바 객체와 SQL의 입출력 값을 직관적으로 바인딩할 수 있다.
동적 SQL을 조합 할 수 있다.

<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<!--mybatis -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.2</version>
</dependency>
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dev_db?serverTimezone=UTC&useSSL=false
spring.datasource.username=hdcd
spring.datasource.password=1234
mybatis.config-location=classpath:mybatis-config.xml
mybatis.mapper-locations=classpath:mappers/**/*.xml
package com.spring.mybatis;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
**@MapperScan(basePackages="com.spring.mybatis.mapper")**
@SpringBootApplication
public class Ch12MybatisApplication {
public static void main(String[] args) {
SpringApplication.run(Ch12MybatisApplication.class, args);
}
}