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
반응형
'DB Story' 카테고리의 다른 글
[ Mybatis ] foreach (0) | 2016.09.08 |
---|---|
[ Mybatis ] the content of elements must consist of well-formed character data or markup (0) | 2016.09.08 |
[ RRD ] rrd graph y-aixs unit (0) | 2016.06.29 |
[ Mysql ] 특정 필드명 보기 (0) | 2016.05.04 |
[ RRD ] 데이터 저장 기간 설정하기 (0) | 2016.04.21 |
[ DB ] execute / executeQuery / executeUpdate 차이 (0) | 2016.01.29 |
[ DB ] INSERT 데이터 삽입 (0) | 2016.01.29 |
[ DB ] DB 테이블 연산자 - JOIN 연산자 (두 개 이상 테이블 간의 비교검색) (0) | 2016.01.29 |