sun.log
로그인
sun.log
로그인
MyBatis HashMap ResultMap Null 오류
sunlog
·
2022년 2월 15일
팔로우
0
MyBatis
Spring
0
트러블 슈팅
목록 보기
3/3
문제
모두 select절에 넣어서 하나하나 select를 했음에도 null인 값들은 아예 select해주지 않음
원인
myBaitis 3.2.2 버전 이후로 resultType에 HashMap(or Map)을 사용하면 데이터가 Null인 컬럼은 Map의 KeySet에 제외가 됨
해결방법
mybatis config xml 파일에 아래 설정 추가
<
settings
>
<
setting
name
=
"
callSettersOnNulls
"
value
=
"
true
"
/>
</
settings
>
sunlog
팔로우
이전 포스트
wsl CentOS8 systemctl 오류
0개의 댓글
댓글 작성