[TIL] 220721

Moon·2022년 7월 22일
0
could not execute statement; SQL [n/a]; constraint ["FKODNXQFC2TSP36OUGV7REUHXRP: 
PUBLIC.SCHEDULE FOREIGN KEY(POST_ID) 
REFERENCES PUBLIC.POST(ID) (CAST(1 AS BIGINT))"; SQL statement:
delete from post where id=? [23503-214]]; nested exception is 
org.hibernate.exception.ConstraintViolationException: 
could not execute statement

@OnDelete(action = OnDeleteAction.CASCADE)
  • 회원 삭제 -> 여행 게시물, 커뮤니티 게시물 삭제 부분 오류 해결하기
  • @Transactional 이해하고 사용하기
  • 외래키, 무결성 제약 조건
  • JPA 영속성, 연관관계 매핑

참고)

https://ynzu-dev.tistory.com/m/entry/OnDelete-VS-cascade-CascadeTypeREMOVE

profile
매일 성장하는 개발자 되기😊

0개의 댓글