Skip to content

Conversation

@namgigun
Copy link
Collaborator

📌 개요

  • AttachmentMappingFileAttachment 간의 연관관계 구조를 재정의
  • 삭제 시 연쇄 삭제(cascade delete) 동작을 검증하는 테스트 케이스를 추가

🔨 작업 내용

🔁 연관관계 재정의

  • 기존의 다대일(또는 단방향) 관계를 일대일 양방향 관계로 변경
  • 연관관계의 주인을 AttachmentMapping으로 설정 (@OneToOne(mappedBy 제거))
  • cascade = CascadeType.ALL, orphanRemoval = true 옵션 추가로 연쇄 삭제 보장

🧪 테스트 케이스 추가

  • AttachmentMapping 삭제 시 연관된 FileAttachment가 자동으로 삭제되는지 검증

🔗 관련 이슈

Closes #290

📝 참고 사항

✅ 체크리스트

  • 기능 동작 확인
  • 테스트 코드 작성
  • 문서/주석 추가 및 최신화

두 관계 변경
- 기존: 다대일 관계 (일:FileAttachment, 다: AttachmentMapping)
- 변경: 일대일 관계

연관관계 주인 변경
- 기존: FileAttachment
- 변경: AttachmentMapping
- AttachmentMapping이 삭제되면 연관된 FileAttachment도 같이 삭제되는지 체크
@github-actions github-actions bot changed the title Fix: 파일관련 엔티티 수정 Fix: 파일관련 엔티티 수정 (#290) Oct 14, 2025
@namgigun namgigun merged commit 3bff555 into dev Oct 14, 2025
3 checks passed
@github-actions github-actions bot deleted the Fix/290 branch October 14, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants