개발새발
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할 때 생긴다고 한다
'오류' 카테고리의 다른 글
Oauth2 yml파일 설정 오류 (0) | 2022.09.14 |
---|---|
Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException" (0) | 2022.09.13 |
sql 에러 (0) | 2022.08.03 |
StringIndexOutOfBoundsException (0) | 2022.08.03 |
오류라기보다 ArrayList변환 (0) | 2022.07.27 |
Comments