DB Story

[ Mybatis ] Type handler was null on parameter mapping for property '__frch_item_0.value'.

WhiteDuck 2016. 10. 18. 16:50


mybatis 사용시에 parameterType안에 List가 들어있을 경우 다음과 같이 하면 



<foreach collection="list" index="index" item="item" separator="," open="(" close=")"> #{item.value} </foreach>


이런 에러가 난다.


Type handler was null on parameter mapping for property '__frch_item_0.value'.



다음과 같이 객체를 집어 넣을 경우 (위의 경우도 이와 같이 넣었다. )


List<String> list = new ArrayList<String>();


MyObj obj = new MyObj();


obj.list = list; <= mybatis parameter


아래와 같이 item.value 대신에 item을 집어 넣는다. 타입이 문제일 수도 있으니 jdbcType도 집어 넣자.


<foreach collection="list" index="index" item="item" separator="," open="(" close=")" >

#{item,jdbcType=VARCHAR} </foreach>



참조 : https://github.com/mybatis/mybatis-3/issues/592



반응형