[mybatis] 반복되는 query 줄이기(sql - include) iBatis/MyBatis

같은 쿼리를 다른 쿼리에서 일부분 사용한다거나  그렇게 반복이 될 때

다음과 같이 사용하면 좋다


...
<mapper>
....


<sql id="a">
SELECT * FROM TABLE1
</sql>


<select id="getList" resultType="hashmap">
<include refid="a" />
WHRE name = #{value}
</select>

</mapper>



트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://marobiana.egloos.com/tb/1090999 [도움말]

덧글

댓글 입력 영역