에러 발생
- MyBatis에서 Java Collection의 List와 String을 비교하면서 에러 발생
에러 코드
<if test="itemList != null and itemList != ''">
AND ITEM_ID IN
<foreach collection="itemList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
해결 방법
- List에 맞는 조건으로 수정하기
수정한 코드
<if test="itemList.size != 0">
AND ITEM_ID IN
<foreach collection="itemList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
'Error & Exception' 카테고리의 다른 글
[Server] java.net.ConnectException: Connection timed out: connect (0) | 2022.01.24 |
---|---|
[API] kakao is not defined (0) | 2022.01.03 |
[Java] @Transactional(readOnly = true) (0) | 2021.12.09 |
[Tomcat] 404 에러 or Whitelabel Error Page (0) | 2021.12.08 |
[Java] actual and formal argument lists differ in length (0) | 2021.12.02 |
댓글