Skip to content

feat: UnivApplyInfo extra_info JSON 컬럼 추가#731

Merged
sukangpunch merged 3 commits into
developfrom
feat/728-extra-info-entity-and-migration
Jun 8, 2026
Merged

feat: UnivApplyInfo extra_info JSON 컬럼 추가#731
sukangpunch merged 3 commits into
developfrom
feat/728-extra-info-entity-and-migration

Conversation

@sukangpunch

Copy link
Copy Markdown
Contributor

Summary

  • university_info_for_apply 테이블에 extra_info JSON NULL 컬럼 추가 (V49 Flyway 마이그레이션)
  • UnivApplyInfo 엔티티에 extraInfo 필드(Map<String, String>) 및 updateExtraInfo() 메서드 추가

Changes

파일 내용
V49__add_extra_info_to_university_info_for_apply.sql extra_info JSON NULL 컬럼 추가 DDL
UnivApplyInfo.java @JdbcTypeCode(SqlTypes.JSON) 필드 및 업데이트 메서드 추가

Test plan

  • Flyway 마이그레이션 정상 적용 확인 (./gradlew build)
  • UnivApplyInfo 엔티티 조회 시 extraInfo 필드 null 허용 확인

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@sukangpunch, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 28 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 333b6c01-2cf8-46a2-86cc-802bc00ef2af

📥 Commits

Reviewing files that changed from the base of the PR and between 9ec0e79 and 4a2c6d7.

📒 Files selected for processing (1)
  • src/test/java/com/example/solidconnection/university/fixture/UnivApplyInfoFixtureBuilder.java

Walkthrough

이 PR에서는 대학 지원 정보(UnivApplyInfo)에 유연한 추가 메타데이터를 저장할 수 있는 기능을 추가합니다. 변경사항은 다음과 같습니다:

  1. 데이터베이스 마이그레이션: university_info_for_apply 테이블에 extra_info 컬럼을 JSON 타입으로 추가합니다(NULL 허용).

  2. 엔티티 모델 업데이트:

    • Hibernate의 JSON 타입 매핑을 위한 import(@JdbcTypeCode, SqlTypes)를 추가합니다.
    • UnivApplyInfo 엔티티에 Map<String, String> 타입의 extraInfo 필드를 추가하고, @Column(columnDefinition = "JSON")@JdbcTypeCode(SqlTypes.JSON) 어노테이션으로 JSON 컬럼으로 매핑합니다.
    • extraInfo 값을 업데이트하는 updateExtraInfo(Map<String, String> extraInfo) 퍼블릭 메서드를 추가합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • wibaek
  • whqtker
  • lsy1307
  • Hexeong
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 주요 변경사항인 UnivApplyInfo에 extra_info JSON 컬럼 추가를 명확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명은 Summary와 Changes 섹션을 포함하여 주요 변경사항을 상세히 기술하고 있으나, 템플릿의 필수 섹션인 '관련 이슈'가 누락되어 있습니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/728-extra-info-entity-and-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sukangpunch sukangpunch self-assigned this Jun 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/main/java/com/example/solidconnection/university/domain/UnivApplyInfo.java (2)

103-105: ⚡ Quick win

방어적 복사를 고려해주세요.

현재 구현은 전달받은 Map 참조를 직접 저장하므로, 호출자가 나중에 Map을 수정하면 엔티티 상태가 예상치 못하게 변경될 수 있습니다.

🛡️ 방어적 복사 구현 제안
 public void updateExtraInfo(Map<String, String> extraInfo) {
-    this.extraInfo = extraInfo;
+    this.extraInfo = extraInfo != null ? new HashMap<>(extraInfo) : null;
 }

이렇게 하면 외부 코드가 전달한 Map을 수정해도 엔티티에 영향을 주지 않습니다. 필요에 따라 Collections.unmodifiableMap()으로 감싸 불변성을 보장할 수도 있습니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/example/solidconnection/university/domain/UnivApplyInfo.java`
around lines 103 - 105, The updateExtraInfo method in UnivApplyInfo currently
stores the incoming Map reference directly, allowing external mutation to affect
the entity; change updateExtraInfo to defensively copy the input (e.g., if
extraInfo is null set an empty map, otherwise assign new HashMap<>(extraInfo))
and optionally wrap with Collections.unmodifiableMap(...) before setting the
field to preserve immutability and protect the entity's extraInfo state.

91-91: ⚡ Quick win

Map<String, String> 타입의 제약사항을 검토해주세요.

현재 Map<String, String> 타입은 값을 문자열로만 제한합니다. 향후 extra_info에 중첩 객체, 배열, 숫자, 불린 등 다양한 JSON 타입을 저장해야 할 경우 타입 변환이 필요합니다.

🔄 더 유연한 타입으로 변경 고려

만약 향후 확장성이 중요하다면 Map<String, Object>나 커스텀 DTO를 고려해보세요:

-private Map<String, String> extraInfo;
+private Map<String, Object> extraInfo;

또는 타입 안전성이 중요하다면 전용 클래스를 정의할 수도 있습니다:

`@Embeddable`
public class ExtraInfo {
    // 명확한 필드 정의
}

현재 요구사항이 문자열 키-값 쌍만 필요하다면 현재 설계도 충분히 적합합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/example/solidconnection/university/domain/UnivApplyInfo.java`
at line 91, The extraInfo field in UnivApplyInfo is currently typed Map<String,
String>, which restricts stored JSON to strings; change it to a more flexible
type (e.g., Map<String, Object>) or replace it with a dedicated DTO/Embeddable
class (e.g., ExtraInfo) to support nested objects, arrays, numbers and booleans,
and then update the UnivApplyInfo.extraInfo getter/setter and any JPA mapping or
AttributeConverter/serialization logic (or column definition) that persists this
field so the new type is correctly serialized/deserialized.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@src/main/java/com/example/solidconnection/university/domain/UnivApplyInfo.java`:
- Around line 103-105: The updateExtraInfo method in UnivApplyInfo currently
stores the incoming Map reference directly, allowing external mutation to affect
the entity; change updateExtraInfo to defensively copy the input (e.g., if
extraInfo is null set an empty map, otherwise assign new HashMap<>(extraInfo))
and optionally wrap with Collections.unmodifiableMap(...) before setting the
field to preserve immutability and protect the entity's extraInfo state.
- Line 91: The extraInfo field in UnivApplyInfo is currently typed Map<String,
String>, which restricts stored JSON to strings; change it to a more flexible
type (e.g., Map<String, Object>) or replace it with a dedicated DTO/Embeddable
class (e.g., ExtraInfo) to support nested objects, arrays, numbers and booleans,
and then update the UnivApplyInfo.extraInfo getter/setter and any JPA mapping or
AttributeConverter/serialization logic (or column definition) that persists this
field so the new type is correctly serialized/deserialized.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6842a604-0a73-4901-ba14-fe8c7c834927

📥 Commits

Reviewing files that changed from the base of the PR and between 1436d72 and 9ec0e79.

📒 Files selected for processing (2)
  • src/main/java/com/example/solidconnection/university/domain/UnivApplyInfo.java
  • src/main/resources/db/migration/V49__add_extra_info_to_university_info_for_apply.sql

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@whqtker whqtker added the 최종 리뷰 최소 1명 필수 label Jun 8, 2026

@whqtker whqtker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

확인했습니당 ~

@sukangpunch sukangpunch merged commit 88d603e into develop Jun 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

리팩터링 최종 리뷰 최소 1명 필수

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants