Skip to content

fix(#311): entity 이름 변경: user_tag -> tag_user, brand_tag -> tag_brand#312

Merged
Yoonchulchung merged 3 commits intodevfrom
fix/311-entity
Feb 8, 2026
Merged

fix(#311): entity 이름 변경: user_tag -> tag_user, brand_tag -> tag_brand#312
Yoonchulchung merged 3 commits intodevfrom
fix/311-entity

Conversation

@Yoonchulchung
Copy link
Copy Markdown
Member

Summary

Tag_User 엔티티에 isDeprecated가 추가되면서 DB에 반영되지 않아 조회에서 문제가 발생.
DB를 업데이트하고, 도메인 별로 다른 Entity라는 것을 명시하기 위해 이름 변경.

Changes

엔티티 수정:

  • TagBrand.java:44: 생성자 이름 BrandTag → TagBrand
  • Brand.java:130: 메서드 addBrandTag(BrandTag) → addTagBrand(TagBrand)
    BrandService 수정:
  • brand.getBrandTags() → brand.getTagsBrand()
  • brand.addBrandTag(BrandTag.builder()...) → brand.addTagBrand(TagBrand.builder()...)
  • update 메서드에서 DTO 호출을 getBrandTags()로 통일

Type of Change

  • Bug fix (기존 기능에 영향을 주지 않는 버그 수정)
  • New feature (기존 기능에 영향을 주지 않는 새로운 기능 추가)
  • Breaking change (기존 기능에 영향을 주는 수정)
  • Refactoring (기능 변경 없는 코드 개선)
  • Documentation (문서 수정)
  • Chore (빌드, 설정 등 기타 변경)
  • Release (develop → main 배포)

Related Issues

#311

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Yoonchulchung, 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은 user_tagbrand_tag 엔티티 및 관련 테이블의 이름을 각각 tag_usertag_brand로 변경하여 데이터베이스의 일관성을 높이고, Tag_User 엔티티의 isDeprecated 필드 누락으로 인한 데이터 조회 버그를 수정하는 데 중점을 둡니다. 이 변경은 코드 전반에 걸쳐 엔티티 참조를 업데이트하고, 데이터 생성 스크립트의 일부 기능을 조정하는 것을 포함합니다.

Highlights

  • 엔티티 및 테이블 이름 변경: user_tag 엔티티와 테이블을 tag_user로, brand_tag 엔티티와 테이블을 tag_brand로 변경했습니다. 이는 도메인별 엔티티를 명확히 하고, Tag_User 엔티티의 isDeprecated 필드가 DB에 반영되지 않아 발생했던 조회 문제를 해결하기 위함입니다.
  • 관련 코드 업데이트: 이름 변경에 따라 BrandService, MatchServiceImpl, UserFeatureService 등 관련 서비스 로직, 엔티티 클래스, 리포지토리 인터페이스 및 데이터 생성 스크립트(redis_matching_generator.py, tag_generator.py, main.py)의 모든 참조를 업데이트했습니다.
  • 데이터 생성 로직 임시 비활성화: 데이터 생성 스크립트에서 generate_user_documentsgenerate_user_tags 메서드 호출과 ChatGenerator 관련 코드를 임시로 주석 처리했습니다. 또한, --brands--campaigns 인수의 기본값을 조정했습니다.
Changelog
  • data/generators/redis_matching_generator.py
    • SQL 쿼리에서 brand_tagtag_brand로 변경했습니다.
    • generate_user_documents 메서드와 해당 호출을 주석 처리하여 사용자 문서 생성을 비활성화했습니다.
  • data/generators/tag_generator.py
    • SQL 쿼리에서 user_tagtag_user로, brand_tagtag_brand로 변경했습니다.
    • generate_user_tags 메서드 호출을 주석 처리하여 사용자 태그 생성을 비활성화했습니다.
  • data/main.py
    • _clear_existing_data 함수에서 user_tagbrand_tag 테이블 이름을 tag_usertag_brand로 업데이트했습니다.
    • ChatGenerator 관련 코드를 주석 처리했습니다.
    • --brands--campaigns 인수의 기본값을 각각 20000에서 2000으로, 30000에서 3000으로 조정했습니다.
  • src/main/java/com/example/RealMatch/brand/application/service/BrandService.java
    • BrandTag import를 TagBrand로 변경했습니다.
    • brand.getBrandTags() 호출을 brand.getTagsBrand()로 변경했습니다.
    • brand.addBrandTag() 호출을 brand.addTagBrand()로 변경했습니다.
    • BrandTag.builder()TagBrand.builder()로 변경했습니다.
  • src/main/java/com/example/RealMatch/brand/domain/entity/Brand.java
    • BrandTag import를 TagBrand로 변경했습니다.
    • brandTags 필드 이름을 tagsBrand로 변경했습니다.
    • addBrandTag 메서드 이름을 addTagBrand로 변경하고 파라미터 타입을 업데이트했습니다.
  • src/main/java/com/example/RealMatch/match/application/service/MatchServiceImpl.java
    • UserTag import를 TagUser로, UserTagRepository import를 TagUserRepository로 변경했습니다.
    • userTagRepository 필드 이름을 tagUserRepository로 변경했습니다.
    • userTagRepository.deleteByUserId() 호출을 tagUserRepository.deleteByUserId()로 변경했습니다.
    • UserTag.builder()TagUser.builder()로 변경하고 userTags 변수 이름을 tagsUser로 변경했습니다.
    • 일부 private final 필드의 선언 순서를 재정렬했습니다.
  • src/main/java/com/example/RealMatch/tag/domain/entity/BrandTag.java
    • 파일 이름을 BrandTag.java에서 TagBrand.java로 변경했습니다.
    • 클래스 이름을 BrandTag에서 TagBrand로 변경했습니다.
    • @Table(name = "brand_tag")@Table(name = "tag_brand")로 변경했습니다.
    • 생성자 이름을 BrandTag에서 TagBrand로 변경했습니다.
  • src/main/java/com/example/RealMatch/tag/domain/entity/UserTag.java
    • 파일 이름을 UserTag.java에서 TagUser.java로 변경했습니다.
    • 클래스 이름을 UserTag에서 TagUser로 변경했습니다.
    • @Table(name = "user_tag")@Table(name = "tag_user")로 변경했습니다.
    • isDeprecated 필드의 초기화 방식과 생성자 파라미터 타입을 Boolean에서 boolean으로 변경했습니다.
    • 생성자 이름을 UserTag에서 TagUser로 변경했습니다.
  • src/main/java/com/example/RealMatch/tag/domain/repository/TagBrandRepository.java
    • JpaRepository의 제네릭 타입을 BrandTag에서 TagBrand로 변경했습니다.
    • JPQL 쿼리에서 BrandTag 별칭 btTagBrand 별칭 tb로 변경했습니다.
    • 메서드의 반환 타입을 List<BrandTag>에서 List<TagBrand>로 변경했습니다.
  • src/main/java/com/example/RealMatch/tag/domain/repository/TagUserRepository.java
    • 새로운 파일이 추가되었습니다. UserTagRepository.java를 대체합니다.
    • TagUserRepository 인터페이스를 정의하고 JpaRepository<TagUser, Long>을 상속합니다.
    • findAllByUserIdWithTag, findAllByUserId, deleteByUserId 메서드를 포함하며 TagUser 엔티티를 사용합니다.
  • src/main/java/com/example/RealMatch/tag/domain/repository/UserTagRepository.java
    • 파일이 삭제되었습니다. TagUserRepository.java로 대체되었습니다.
  • src/main/java/com/example/RealMatch/user/application/service/UserFeatureService.java
    • UserTag import를 TagUser로, UserTagRepository import를 TagUserRepository로 변경했습니다.
    • userTagRepository 필드 이름을 tagUserRepository로 변경했습니다.
    • userTagRepository.findAllByUserIdWithTag() 호출을 tagUserRepository.findAllByUserIdWithTag()로 변경했습니다.
    • 메서드 파라미터 타입을 List<UserTag>에서 List<TagUser>로 변경했습니다.
    • 스트림 매핑을 UserTag::getTag에서 TagUser::getTag로 변경했습니다.
    • 반복문 변수를 UserTag ut에서 TagUser tu로 변경했습니다.
Activity
  • 이 PR에 대한 특정 코멘트나 리뷰 활동은 현재까지 없습니다.
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
Copy Markdown
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은 user_tagtag_user로, brand_tagtag_brand로 엔티티 이름을 변경하는 작업을 성공적으로 수행했습니다. Java 엔티티, 리포지토리, 서비스뿐만 아니라 Python 데이터 생성 스크립트에 이르기까지 코드베이스 전반에 걸쳐 일관성 있게 수정되었습니다. 이를 통해 코드의 명확성과 일관성이 향상되었습니다.

한 가지 작은 개선점을 발견했는데, 주석 처리된 Python 스크립트에서 이전 테이블 이름이 여전히 사용되고 있는 부분입니다. 이를 수정하면 나중에 해당 코드를 다시 활성화할 때 발생할 수 있는 잠재적인 문제를 예방할 수 있습니다.

# # user_tag 매핑 정보 조회
# cursor.execute("""
# SELECT ut.user_id, ut.tag_id, t.tag_type, t.tag_category
# FROM user_tag ut
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

현재 이 코드는 주석 처리되어 있지만, 나중에 주석을 해제하고 사용할 경우를 대비하여 이전 테이블명인 user_tagtag_user로 수정하는 것이 좋습니다. 이렇게 하면 향후 발생할 수 있는 오류를 미리 방지하고 코드의 일관성을 유지할 수 있습니다.

Suggested change
# FROM user_tag ut
# FROM tag_user ut

@Yoonchulchung Yoonchulchung merged commit 9e1ad5a into dev Feb 8, 2026
1 check passed
@Yoonchulchung Yoonchulchung deleted the fix/311-entity branch February 8, 2026 02:41
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.

1 participant