resultMap을 사용한 JOIN문 1:N관계 받아오기
참조 ● http://ssodang.tistory.com/entry/MyBatis ● http://krespo.net/162 MyBatis를 사용하면서 게시판 테이블에 댓글 테이블이 1:N관계로 FK로 묶여있는 경우가 있다 이럴 경우에 ResultMap을 이용하면 쿼리를 받아온 후 서버에서 for문으로 쿼리를 또 확인하여 던질 필요가 없어진다. 1:N관계에서 1에 해당하는 클래스에 N에 해당하는 VO객체를 ArrayList형태로 추가해준다. OptionVO @Alias("optionVO") public class OptionVO { private int id; private Timestamp created_on; private Timestamp updated_on; private Timestamp del..
MyBatis
2018. 2. 27. 12:15