Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughORM 설정 파일에 새로운 엔티티 매핑 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ 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.
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.AdminRefreshTokenas an<entity>inorm.xml - Map columns for
id,admin_id,token,expires_at,created_attoadmin_refresh_tokentable
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <basic name="adminId"> | ||
| <column name="admin_id" column-definition="uuid" nullable="false"/> | ||
| </basic> |
There was a problem hiding this comment.
adminId에 대해 findByAdminId(UUID)가 Optional을 반환하고 서비스 로직이 1개 레코드만 존재한다고 가정하는데, 현재 테이블/매핑에는 admin_id 유니크 제약이 없습니다. 동시 로그인 등으로 동일 admin_id 행이 여러 개 생기면 조회 시 NonUniqueResultException 등으로 터질 수 있으니, 의도가 '어드민당 1개의 리프레시 토큰'이라면 DB(및 orm.xml) 레벨에서 admin_id UNIQUE 제약(또는 (admin_id) 유니크 인덱스)을 추가하는 쪽이 안전합니다.
| <column name="admin_id" column-definition="uuid" nullable="false"/> | ||
| </basic> | ||
| <basic name="token"> | ||
| <column name="token" nullable="false"/> |
There was a problem hiding this comment.
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")를 매핑에 반영해 주세요.
| <column name="token" nullable="false"/> | |
| <column name="token" nullable="false" length="500" unique="true"/> |
Summary by CodeRabbit
릴리스 노트