앱)mybatis resultMap과 resultType 차이
resultMap 방식
<resultMap id="result" type="XXXVO">
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
</resultMap>
<select id="resultmaptest" parameterType="YYYVO" resultMap="result">
....쿼리....
</select>
resultType방식
<select id="resultTypetest" parameterType="searchVo" resultType="outputVO">
<select id="resultTypetest" parameterType="searchVo" resultType="int">
<select id="resultTypetest" parameterType="searchVo" resultType="String">
<select id="resultTypetest" parameterType="searchVo" resultType="map">
...쿼리...
</select>
<resultMap id="result" type="XXXVO">
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
<result property="id" column="ID" />
</resultMap>
<select id="resultmaptest" parameterType="YYYVO" resultMap="result">
....쿼리....
</select>
resultType방식
<select id="resultTypetest" parameterType="searchVo" resultType="outputVO">
<select id="resultTypetest" parameterType="searchVo" resultType="int">
<select id="resultTypetest" parameterType="searchVo" resultType="String">
<select id="resultTypetest" parameterType="searchVo" resultType="map">
...쿼리...
</select>
'백엔드개발 > 자바스프링' 카테고리의 다른 글
앱)java spring application Config xml방식 (0) | 2018.11.14 |
---|---|
앱)대량호출 방어로직 및 checkusersession (0) | 2018.11.14 |
앱)select box 선택시에 팝업이 뜨는 로직정리 (0) | 2018.11.14 |
앱)mysql sequence 쿼리 샘플 (0) | 2018.11.14 |
앱)mybatis config.xml (0) | 2018.11.14 |