[JPA] HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance @OneToMany 문제
·
Server/Error
예외 발생 현황 Post를 삭제했을 때, Comment와 Like가 함께 삭제될 수 있도록 Post Entity에 Comment와 Like를 @OneToMany를 사용하여 cascade, orphanRemoval을 사용하여 엮었다. Post Entity @AllArgsConstructor @NoArgsConstructor @Getter @Builder @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) @Entity @SQLDelete(sql = "UPDATE post SET deleted_at = current_timestamp WHERE id = ?") @Where(clause = "deleted_at is null") public cl..