[Spring] Null value was assigned to a property 오류가 뜰 때

bluemind·2022년 11월 22일
0

jpa

목록 보기
1/5

Entity 설정 오류!

DB에서 not null 지정이 안되어 있는 컬럼(null값이 들어갈 수 있는 컬럼)의 속성 타입이 자바에서 Primitive Type으로 되어 있기 때문!

primitiveType 종류

boolean, byte, short, int, long, float, double, char


이러한 타입들은 null값을 담을 수 없다.

해결볍 int -> Integer로 바꿔준다


Entity 설정 시
Long 타입으로 선언해준다!

profile
실력있는 개발자가 되기 위한 여정

0개의 댓글