From bb81584c4fdd20f4d4a21352f146e3d9f9348668 Mon Sep 17 00:00:00 2001 From: Dario Date: Mon, 11 Mar 2024 23:07:24 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20fixed=20query=20Co-authored-by:=20Gonzal?= =?UTF-8?q?o=20Su=C3=A1rez=20Losada=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lab/en2b/quizapi/questions/question/QuestionRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/lab/en2b/quizapi/questions/question/QuestionRepository.java b/api/src/main/java/lab/en2b/quizapi/questions/question/QuestionRepository.java index b07b1f8b..eb4bef47 100644 --- a/api/src/main/java/lab/en2b/quizapi/questions/question/QuestionRepository.java +++ b/api/src/main/java/lab/en2b/quizapi/questions/question/QuestionRepository.java @@ -4,6 +4,6 @@ import org.springframework.data.jpa.repository.Query; public interface QuestionRepository extends JpaRepository { - @Query(value = "SELECT q FROM questions WHERE q.language=?1 ORDER BY RANDOM() LIMIT 1", nativeQuery = true) + @Query(value = "SELECT * FROM questions WHERE language=?1 ORDER BY RANDOM() LIMIT 1", nativeQuery = true) Question findRandomQuestion(String lang); }