Skip to content

[BE] 마인드맵 내부 역량 태그 조회 fix#371

Merged
w0uldy0u merged 5 commits intodevfrom
fix/#367/fix_get_all_competency_types_of_mindmap
Feb 15, 2026
Merged

[BE] 마인드맵 내부 역량 태그 조회 fix#371
w0uldy0u merged 5 commits intodevfrom
fix/#367/fix_get_all_competency_types_of_mindmap

Conversation

@w0uldy0u
Copy link
Collaborator

Closes #367

목적

500에러를 일으켰던 기존 마인드맵 내부 역량 태그 조회 API를 고칩니다.

작업 내용

  • JPQL을 사용하던걸 네이티브 쿼리로 수정합니다.
  • 테스트 코드를 리팩토링 합니다.

결과

image image

@w0uldy0u w0uldy0u requested a review from kimhji February 14, 2026 14:11
@w0uldy0u w0uldy0u self-assigned this Feb 14, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @w0uldy0u, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 마인드맵 내 역량 태그 조회 시 발생하던 서버 오류를 해결하는 데 중점을 둡니다. 기존 JPQL 쿼리의 한계를 극복하기 위해 네이티브 SQL 쿼리를 도입하여 데이터 조회 로직을 개선했으며, 관련 테스트 코드를 리팩토링하여 견고성을 확보했습니다.

Highlights

  • 마인드맵 역량 태그 조회 API 오류 수정: 마인드맵 내부 역량 태그 조회 API에서 발생하던 500 에러를 수정했습니다.
  • 네이티브 SQL 쿼리 전환: EpisodeRepositoryfindCompetencyTypesByMindmapId 쿼리를 JPQL에서 JSON_TABLE을 활용한 네이티브 SQL 쿼리로 변경했습니다.
  • 테스트 코드 리팩토링: 테스트 코드의 가독성과 재사용성을 높이기 위해 EpisodeRepositoryTest, MindmapRepositoryTest, TestEntityFactory를 리팩토링했습니다.
  • EpisodeId 클래스 개선: EpisodeId 임베디드 클래스에 Lombok 어노테이션을 적용하고 컬럼에 nullable = false 제약 조건을 추가했습니다.
Changelog
  • backend/api/src/main/java/com/yat2/episode/episode/EpisodeId.java
    • 수동으로 구현된 equals, hashCode, 생성자 및 setter 메서드가 제거되었습니다.
    • Lombok의 @EqualsAndHashCode, @AllArgsConstructor, @NoArgsConstructor 어노테이션이 추가되었습니다.
    • nodeIduserId 컬럼에 nullable = false 제약 조건이 추가되었습니다.
  • backend/api/src/main/java/com/yat2/episode/episode/EpisodeRepository.java
    • findEpisodesByMindmapIdAndUserId JPQL 쿼리가 제거되었습니다.
    • findCompetencyTypesByMindmapId 쿼리가 JPQL에서 JSON_TABLE을 사용하는 네이티브 SQL 쿼리로 변환되었습니다.
  • backend/api/src/test/java/com/yat2/episode/episode/EpisodeRepositoryTest.java
    • EpisodeRepository의 기능(nodeId 조회, 상세 리스트 조회, 에피소드 상세 조회, 역량 태그 중복 제거 조회)을 검증하는 새로운 통합 테스트 파일이 추가되었습니다.
  • backend/api/src/test/java/com/yat2/episode/mindmap/MindmapRepositoryTest.java
    • ReflectionTestUtils를 사용한 MindmapParticipant 생성 로직이 제거되었습니다.
    • 테스트 데이터 생성을 위해 TestEntityFactory의 새로운 헬퍼 메서드(createUser, createParticipant)를 사용하도록 업데이트되었습니다.
    • saveParticipant 헬퍼 메서드가 제거되었습니다.
  • backend/api/src/test/java/com/yat2/episode/utils/AbstractRepositoryTest.java
    • @Testcontainers 어노테이션이 제거되었습니다.
    • MySQL 컨테이너 이미지 버전이 DockerImageName을 사용하여 명시적으로 mysql:8.0.45로 지정되었습니다.
    • spring.datasource.driver-class-name 설정이 MYSQL::getDriverClassName을 사용하도록 변경되었습니다.
  • backend/api/src/test/java/com/yat2/episode/utils/TestEntityFactory.java
    • createMindmap 오버로드 메서드, createParticipant, createUser, createEpisode, createEpisodeStar 등 테스트 엔티티 생성을 위한 헬퍼 메서드들이 추가되어 테스트 코드 작성을 간소화했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 마인드맵 내 역량 태그 조회 API에서 발생하던 500 에러를 수정하고, 관련 테스트 코드를 리팩토링하는 작업을 포함하고 있습니다. JPQL에서 지원하지 않는 JSON 타입 필드 조회를 위해 네이티브 쿼리와 JSON_TABLE 함수를 사용한 해결 방법은 적절합니다. 또한, 테스트 코드 전반에 걸쳐 TestEntityFactory를 도입하고 중복 코드를 제거하여 테스트의 가독성과 유지보수성을 크게 향상시킨 점이 인상적입니다. AbstractRepositoryTest에서 Testcontainers 설정을 개선한 부분도 좋은 변경입니다. 전반적으로 코드 품질을 높이는 좋은 변경이라고 생각합니다. 한 가지 작은 개선점을 TestEntityFactory에 제안했습니다.

Copy link
Collaborator

@kimhji kimhji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯
오류 나는 부분 처리해주셔서 감사합니다 😄

@w0uldy0u w0uldy0u merged commit f1c3f5f into dev Feb 15, 2026
3 checks passed
@w0uldy0u w0uldy0u deleted the fix/#367/fix_get_all_competency_types_of_mindmap branch February 15, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BE] 마인드맵 내부 역량 태그 조회 fix

2 participants