Spring/mybatis (1) 썸네일형 리스트형 mapper 등록 두 가지 방법 SqlSessionFactoryBean 스프링과 mybatis가 결합되었을때, SqlSessionFactoryBean을 통해 SqlSessionFactory객체를 생성한다. SqlSessionFactory는 데이터베이스와의 연결과 SQL의 실행에 대한 모든 것을 가진 가장 중요한 객체다. SqlSessionFactory를 설정할땐 두가지의 필수 프로퍼티가 필요한데, DataSource와 configLocation이다. JDBC DataSource를 참조하여 MyBatis와 database서버를 연동시켜주고, configLocation을 참조하여 Configuration.xml 에 있는 변경된 mybatis설정을 반영한다. 스프링에선 SqlSessionFactory를 생성해주는 SqlSessionFacto.. 이전 1 다음