Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

개발새발

org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement 본문

오류

org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement

개발하는후추 2022. 9. 19. 20:06

프로젝트 코드를 짜다가

org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement

이런 오류를 만났다 진짜 몇시간을 찾아봤지만 고치지 못했다

하지만!!!!! 고쳤다 진짜 너무 멍청한 짓을 했던것이다

기존 코드

고친 코드

새로 작성된 comment가 insert되게 해야하는데 아무런 관련도 없고 빈 comment를 db에 넣으려고 하니까 생긴 에러였다

이런 오류는 주로 null 값을 insert할 때 생긴다고 한다

Comments