Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/main/resources/META-INF/orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,27 @@
</attributes>
</entity>

<entity class="com.souzip.domain.admin.AdminRefreshToken">
<table name="admin_refresh_token"/>
<attributes>
<id name="id">
<column name="id" column-definition="uuid" updatable="false" nullable="false"/>
</id>
<basic name="adminId">
<column name="admin_id" column-definition="uuid" nullable="false"/>
</basic>
Comment on lines +128 to +130
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.
<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.
</basic>
<basic name="expiresAt">
<column name="expires_at" nullable="false"/>
</basic>
<basic name="createdAt">
<column name="created_at" nullable="false" updatable="false"/>
</basic>
</attributes>
</entity>

<embeddable class="com.souzip.domain.shared.Coordinate">
<attributes>
<basic name="latitude">
Expand Down
Loading