Skip to content

Commit d37654f

Browse files
committed
hotfix: JPA flush 전 toDomain() 호출로 인한 lateinit 프로퍼티 접근 오류 해결
- UserBookEntity.toDomain()에서 JPA Auditing이 완료되기 전 createdAt/updatedAt 접근 시 발생하는 UninitializedPropertyAccessException 수정
1 parent e94dc96 commit d37654f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

infra/src/main/kotlin/org/yapp/infra/userbook/repository/impl/UserBookRepositoryImpl.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class UserBookRepositoryImpl(
2121
}
2222

2323
override fun save(userBook: UserBook): UserBook {
24-
return jpaUserBookRepository.save(UserBookEntity.fromDomain(userBook)).toDomain()
24+
val savedEntity = jpaUserBookRepository.save(UserBookEntity.fromDomain(userBook))
25+
return savedEntity.toDomain()
2526
}
2627

2728
override fun findAllByUserId(userId: UUID): List<UserBook> {

0 commit comments

Comments
 (0)