feat: UnivApplyInfo extra_info JSON 컬럼 추가#731
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough이 PR에서는 대학 지원 정보(
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 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 winMap<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
📒 Files selected for processing (2)
src/main/java/com/example/solidconnection/university/domain/UnivApplyInfo.javasrc/main/resources/db/migration/V49__add_extra_info_to_university_info_for_apply.sql
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.sqlextra_info JSON NULL컬럼 추가 DDLUnivApplyInfo.java@JdbcTypeCode(SqlTypes.JSON)필드 및 업데이트 메서드 추가Test plan
./gradlew build)UnivApplyInfo엔티티 조회 시extraInfo필드 null 허용 확인🤖 Generated with Claude Code