JPA 오류
- org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.Transaction
해결법 : repository에 @Transaction을 걸어주면 된다.
- org.spring framework.orm.jpa.JpaSystemException: Null value was to a property
위에 오류의 원인은 DB에서 not null 지정이 안되어 있는 컬럼의 속성 타입이 자바에서 Primitive Type으로 되어 있기 때문이다.
자바에서 primitive type은 boolean, byte, short, int, long, float, double, char 인데 null 값은 담을 수 없다.
해결방법은 문제가 발생한 DTO에서 Primitive Type을 Reference Type으로 변경해주면 된다.
ex)int -> ineger
null이 될 수 있는 Reference Type으로 변경해준다.