SQL Mapping XML file은 실행할 SQL 문을 정의해놓은 파일.
SQL 실행을 위해 Parameter Object를 받아오거나 SQL문 실행결과를 Result Object 에 자동 바인딩하는 기능 제공
Mapper XML file에서 사용가능한 요소는 다음과 같다.
http://devyongsik.tistory.com/527 참고!
http://devyongsik.tistory.com/527 참고!
<mapper namespace="com.tistory.devyongsik.mapper.DualMapper">
<resultmap id="dualResultMap" type="DualDomain">
//id:여기서지정, type:dto형태의 데이터담을 객체
<result column="keyword" property="r" jdbctype="VARCHAR">
</result></resultmap>
<select id="selectAll" resultmap="dualResultMap">
select 1 as keyword from dual
</select>
</mapper>