<select id="getBoardDetail" parameterType="int" resultMap="reportMap"> SELECT b.*, writer.NAME AS WRITER_NAME, writer.mobile AS WRITER_MOBILE, editor.NAME AS EDITOR_NAME, editor.mobile AS EDITOR_MOBILE FROM BOARD b JOINUSER writer ON b.WRITER_IDX = writer.IDX JOINUSER editor ON b.EDITOR_IDX = editor.IDX WHERE1=1 AND b.IDX = #{idx} </select>
주의점
association의 resultMap를 동일한 userMap으로 사용하므로 association의 속성인 columnPrefix로 꼭 구분해줘야한다! 이걸 못찾아서 몇시간을 삽질했는지… 절레절레