Framework/myBatis
[Mybatis] 프로시져(procedure) 실행하기
louis.dev
2013. 11. 14. 14:09
ibatis 시절에는 procedure라는 테그가 있어서 해당 테그를 이용해 프로시져를 수행했다면 myBatis에서는 일반 쿼리문 처럼 insert, update, select 문을 통하여 프로시져를 수행할수 있다. insert, update, select 중 어떠한 테그를 사용해도 프로시저를 호출할수 있다.
대신
statementType
=
"CALLABLE" 이라는 속성을 추가해 줘야 프로시져로 인식하여 프로시져를 수행한다.
<update id="execureProcedure" statementType="CALLABLE"> { call procedure_name(#{id}, #{name}) } </update>