From c81b41dbdb7719126ce07c0b552f7edec6b2804b Mon Sep 17 00:00:00 2001 From: jjgancfer Date: Wed, 17 Apr 2024 23:57:18 +0200 Subject: [PATCH] fix: missing SELECT from query --- api/src/main/java/lab/en2b/quizapi/game/GameRepository.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/lab/en2b/quizapi/game/GameRepository.java b/api/src/main/java/lab/en2b/quizapi/game/GameRepository.java index 6f747994..13602f47 100644 --- a/api/src/main/java/lab/en2b/quizapi/game/GameRepository.java +++ b/api/src/main/java/lab/en2b/quizapi/game/GameRepository.java @@ -14,6 +14,7 @@ public interface GameRepository extends JpaRepository { @Query(value = "SELECT * FROM Games g WHERE user_id = ?1 AND g.is_game_over = false LIMIT 1", nativeQuery = true) Optional findActiveGameForUser(Long userId); - @Query(value = "COUNT(*) FROM Games g WHERE user_id = ?1 AND g.is_game_over = true", nativeQuery = true) + @Query(value = "SELECT COUNT(*) FROM Games g WHERE user_id = ?1 AND g" + + ".is_game_over = true", nativeQuery = true) Long countFinishedGamesForUser(Long userId); }