Skip to content

[REFACT] 내 운동 목록 페이징 조회 fetch join 구조 개선 #601

Description

@Dimo-2562

✨ 리팩토링 할 부분

내 참여 운동 페이징 조회에서 collection fetch join + paging 구조를 개선합니다.

배경

  • /api/exercises/my는 Pageable을 받음: ExerciseController.java:321-339
  • repository는 JOIN FETCH e.memberExercises 컬렉션 fetch join으로 Slice<Exercise> 반환
    • ExerciseRepository.java:170-178
    • ExerciseRepository.java:180-189
    • ExerciseRepository.java:191-200
  • Exercise.memberExercises는 one-to-many collection이라 Hibernate 메모리 pagination/중복 row 위험이 있음

수정 방향

  • paging query는 MemberExercise 기준 또는 exercise id 2-step 조회로 변경
  • fetch join은 to-one 관계 중심으로 제한
  • 기존 filter/order 조합 유지
  • 페이지 크기, hasNext, 정렬 회귀 테스트 추가/보강

완료 조건

  • collection fetch join + pageable 조합이 제거된다
  • /api/exercises/my 응답 정렬/필터/hasNext 동작이 유지된다
  • 관련 repository/service/integration 테스트가 통과한다

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🌟 REFACTNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions