Skip to content

Commit

Permalink
Add UserRepositoryImpl saveAll 함수 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
rudeh2926 committed Jan 10, 2024
1 parent 180f5d7 commit 2387118
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ class UserRepositoryImpl(
private val reactiveQueryFactory: HibernateMutinyReactiveQueryFactory,
private val userDomainMapper: UserDomainMapper
) : UserRepositorySpi {

override suspend fun saveAll(user: List<User>) {
val userAllSave = user.map { userDomainMapper.userDomainToEntity(it) }
reactiveQueryFactory.transactionWithFactory { session, _ ->
userAllSave.forEach { userEntity ->
session.persistUserEntityConcurrently(userEntity)
}
}
}

override suspend fun saveUser(user: User): User {
val userEntityToSave = userDomainMapper.userDomainToEntity(user)
reactiveQueryFactory.transactionWithFactory { session, _ ->
Expand Down

0 comments on commit 2387118

Please sign in to comment.