xml의존성이 높다
-
[JSP] MyBatis 적용_2(어노테이션 없이)JAVA/ORM 2024. 7. 30. 18:56
HTML 삽입미리보기할 수 없는 소스 https://hi-hahahoho.tistory.com/93저번 글에서는 configuration.xml과 sqlMapConfig.java 설정을 자세히 봤다. 이번에는 DataMapper.xml과 DAO간 어떻게 사용되는지 정리하겠다. jsp와 같은 앞단은 특별히 달라지는 것은 없다. ✔ DataDao⌨ SqlSessionMyBatis에서 데이터베이스와 실제 세션(sql 쿼리 실행을 준비)을 나타내는 객체이다. SQL 실행 및 트랜잭션 관리를 담당한다. openSession() 메서드를 호출하여 기본 세션을 열고 작업이 끝나면 해당 객체를 해제한다. 🔦 MyBatis는 List 자료구조를 반환한다. 여러 행을 조회할때, 해당 테이블의 모든 행을 조회하고 각 행을 ..