primitive (1) 썸네일형 리스트형 [JPA] Null value was assigned to a property exception 1. 에러 원인 JPA를 사용해 개발을 하다 보면 database column은 nullabel 속성이지만 entity의 field는 primitive 타입으로 설정할 때가 있다. 그럴 때 primitive type에는 null 값을 할당할 수 없어 해당 에러가 발생한다. 2. example Entity 설정 code // TestEntity.java @Getter @Setter @NoArgsConstructor @AllArgsConstructor @Entity public class TestEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private int testPriority; } // TestRep.. 이전 1 다음