-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix : DB 병목 개선 - FindingGameWinner에 데이터 넣을 때 NativeQuery사용 (CC-176) (#47
) * fix : DB 병목 개선 - 프록시 객체 사용 (CC-176) * fix : FindingGameWinner에 데이터 넣을 때 NativeQuery사용 (CC-176) * fix : 스케쥴링 시간 수정 (CC-176) * fix : 사용하지 않는 import 제거 (CC-176) * fix : 트랜잭션 에러 처리 수정 (CC-176)
- Loading branch information
Showing
2 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/main/java/ai/softeer/caecae/findinggame/repository/FindingGameWinnerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
package ai.softeer.caecae.findinggame.repository; | ||
|
||
import ai.softeer.caecae.findinggame.domain.entity.FindingGameWinner; | ||
import io.lettuce.core.dynamic.annotation.Param; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Modifying; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface FindingGameWinnerRepository extends JpaRepository<FindingGameWinner, Integer> { | ||
@Modifying | ||
@Query(value = """ | ||
INSERT IGNORE INTO finding_game_winner (user_id, finding_game_id) | ||
VALUES (:userId, :gameId) | ||
""", nativeQuery = true) | ||
void insertWinner(@Param("userId") Integer userId, @Param("gameId") Integer gameId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters