From 2387118e9cb43fc192cb720193c86a180e1e0a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=8F=84=EA=B2=BD?= Date: Wed, 10 Jan 2024 11:04:10 +0900 Subject: [PATCH] =?UTF-8?q?Add=20UserRepositoryImpl=20saveAll=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/repository/UserRepositoryImpl.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/repository/UserRepositoryImpl.kt b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/repository/UserRepositoryImpl.kt index 7a239c3..157aee9 100644 --- a/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/repository/UserRepositoryImpl.kt +++ b/user-infrastructure/src/main/kotlin/com/xquare/v1userservice/user/repository/UserRepositoryImpl.kt @@ -26,6 +26,16 @@ class UserRepositoryImpl( private val reactiveQueryFactory: HibernateMutinyReactiveQueryFactory, private val userDomainMapper: UserDomainMapper ) : UserRepositorySpi { + + override suspend fun saveAll(user: List) { + 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, _ ->