Skip to content

[FEAT] 문서 참조 영속 모델과 Repository 구현 #200

Description

@jyt6640

작업 설명

현재 그래프 조회는 크루 문서 본문에서 문서 참조를 요청마다 추출하고 계산한다.

후속 문서 쓰기 동기화, backfill 및 영속 참조 조회가 공통으로 사용할 수 있도록 source CrewDocument -> target Document 방향성 참조 모델과 Repository를 구현한다. 이번 작업에서는 서비스, backfill 및 그래프 API 동작을 변경하지 않는다.

작업 목록

  • DocumentReference JPA entity 구현
  • source-target 유일 제약과 source·target index 및 FK 선언
  • source 조회와 outgoing·incoming 삭제 Repository 계약 구현
  • DocumentReferenceFixture와 Repository 통합 테스트 작성
  • CrewDocument -> CrewDocumentCrewDocument -> OrganizationDocument 저장·조회 검증
  • 중복 참조 차단과 reference 삭제 시 Document로 cascade되지 않는지 검증
  • 가능한 MySQL 8 환경에서 table·constraint·index·FK 이름 검증

완료 조건

  • 방향성 참조가 저장·조회·삭제된다.
  • target이 Document의 서로 다른 subtype을 참조할 수 있다.
  • 동일 source-target 중복은 DB 제약으로 차단된다.
  • 같은 source의 여러 target과 같은 target의 여러 source는 허용된다.
  • reference 삭제가 source·target Document 삭제로 전파되지 않는다.
  • 관련 테스트와 Java 17 전체 테스트가 통과한다.
  • 서비스·API·추출기·build.gradle은 변경되지 않는다.
  • 문서 삭제 시 outgoing·incoming 참조를 제거하는 후속 연동 전에는 쓰기 동기화와 backfill을 활성화하지 않는다.

관련 이슈

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions