Skip to content

[NO-ISSUE] orm.xml 에 어드민리프레시토큰 추가#216

Merged
Develop-KIM merged 1 commit intodevelopfrom
fix/NO-ISSUE-properties
Mar 11, 2026
Merged

[NO-ISSUE] orm.xml 에 어드민리프레시토큰 추가#216
Develop-KIM merged 1 commit intodevelopfrom
fix/NO-ISSUE-properties

Conversation

@Develop-KIM
Copy link
Member

@Develop-KIM Develop-KIM commented Mar 11, 2026

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 관리자 새로고침 토큰 관리를 위한 데이터베이스 구조가 업데이트되었습니다.

Copilot AI review requested due to automatic review settings March 11, 2026 11:00
@Develop-KIM Develop-KIM added the feat 기존 기능을 개선하거나 새로운 기능을 추가하는 경우에 사용합니다. label Mar 11, 2026
@Develop-KIM Develop-KIM merged commit 2d658b5 into develop Mar 11, 2026
1 check passed
@Develop-KIM Develop-KIM deleted the fix/NO-ISSUE-properties branch March 11, 2026 11:00
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cb89c4e3-f1e9-4a2b-8426-d734c10308d8

📥 Commits

Reviewing files that changed from the base of the PR and between d9368fd and c854518.

📒 Files selected for processing (1)
  • src/main/resources/META-INF/orm.xml

Walkthrough

ORM 설정 파일에 새로운 엔티티 매핑 com.souzip.domain.admin.AdminRefreshToken이 추가되었습니다. 이는 관리자 리프레시 토큰을 저장하기 위한 테이블을 정의하며, id, adminId, token, expiresAt, createdAt 필드를 포함합니다. 기존 매핑은 수정되지 않았습니다.

Changes

Cohort / File(s) Summary
관리자 리프레시 토큰 ORM 매핑
src/main/resources/META-INF/orm.xml
새로운 AdminRefreshToken 엔티티 매핑 추가. admin_refresh_token 테이블로 매핑되며, UUID 기반 id, adminId, token, expiresAt(만료 시간), createdAt(생성 시간) 등 5개 필드 정의.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/NO-ISSUE-properties

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Hibernate ORM XML mapping for the new AdminRefreshToken domain model so it can be persisted via JPA/Hibernate alongside existing XML-mapped domain objects.

Changes:

  • Register com.souzip.domain.admin.AdminRefreshToken as an <entity> in orm.xml
  • Map columns for id, admin_id, token, expires_at, created_at to admin_refresh_token table

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +128 to +130
<basic name="adminId">
<column name="admin_id" column-definition="uuid" nullable="false"/>
</basic>
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

adminId에 대해 findByAdminId(UUID)Optional을 반환하고 서비스 로직이 1개 레코드만 존재한다고 가정하는데, 현재 테이블/매핑에는 admin_id 유니크 제약이 없습니다. 동시 로그인 등으로 동일 admin_id 행이 여러 개 생기면 조회 시 NonUniqueResultException 등으로 터질 수 있으니, 의도가 '어드민당 1개의 리프레시 토큰'이라면 DB(및 orm.xml) 레벨에서 admin_id UNIQUE 제약(또는 (admin_id) 유니크 인덱스)을 추가하는 쪽이 안전합니다.

Copilot uses AI. Check for mistakes.
<column name="admin_id" column-definition="uuid" nullable="false"/>
</basic>
<basic name="token">
<column name="token" nullable="false"/>
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

token 컬럼이 마이그레이션(V5__create_admin_refresh_token_table.sql)에서는 VARCHAR(500) + UNIQUE 인데, orm.xml 매핑에서는 length/unique 설정이 없어 기본 VARCHAR(255)로 인식될 수 있습니다. Hibernate ddl-auto=validate/update 사용 시 스키마 불일치 또는 잘못된 DDL 생성 위험이 있으니 length="500"(및 DB와 일치하도록 unique="true")를 매핑에 반영해 주세요.

Suggested change
<column name="token" nullable="false"/>
<column name="token" nullable="false" length="500" unique="true"/>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 기존 기능을 개선하거나 새로운 기능을 추가하는 경우에 사용합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants