iBATIS에서 "net.sf.cglib.beans.BulkBeanException"와 같은 오류가 발생했다면
그것은 Integer Type의 Field가 null인 Record가 ResultMap에 Set되었다는 것을 의미한다.
즉, ResultMap의 Property 중 type이 Integer인 것을 찾아 아래와 같이 수정해 주면된다.
<resultMap id="resultSample" class="sample">
<result property="stringProp" column="STRING_PROP" />
<result property="integerProp" column="INTEGER_PROP" />
</resultMap>
<select id="selectSample" resultMap="resultSample">
SELECT STRING_PROP, COALESCE( INTEGER_PROP, 0 ) AS INTEGER_PROP
FROM TB_SAMPLE
</select>
"COALESCE"를 사용해 null인 경우 '0'으로 대치한다.
댓글 없음:
댓글 쓰기