Skip to content

Commit

Permalink
fix: fixed query
Browse files Browse the repository at this point in the history
Co-authored-by: Gonzalo Suárez Losada <uo283928@uniovi.es>
  • Loading branch information
Toto-hitori committed Mar 11, 2024
1 parent cf5a44d commit bb81584
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import org.springframework.data.jpa.repository.Query;

public interface QuestionRepository extends JpaRepository<Question,Long> {
@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);
}

0 comments on commit bb81584

Please sign in to comment.