Mybatis란?

- 개발자가 지정한 SQL, 저장프로시저 그리고 몇가지 고급 매핑을 지원하는 퍼시스턴스 프레임워크
- JDBC로 처리하는 상당부분의 코드와 파라미터 설정및 결과 매핑을 대신해준다.
- 쉽게 말해 JDBC를 사용하기 편리하게 소스코드(JAVA)와 SQL(XML)을분리하여 개발 할 수 있게 해주는 프레임워크
Mybatis 구조

Mybatis 설정
1. pom.xml 의존성 주입

2. DataSource 설정 -> properties 파일로 정보 읽어옴


3. SqlSessionFactory, SqlSessionTemplate 설정

4. TypeAliases
-- mapper resultType 부분에 일일이 패키지명을 적기 번거롭기때문에 typealias 설정을 해두면 편함

Mybatis-Mapper




< Mybatis-Mapper : resultMap >
