In Mysql,
SELECT id FROM table ORDER BY RANDOM() LIMIT 5
this sql can select 5 random rows. How to do this via JPA Query (Hibernate as pro
Try calculating the random beforehand and construct your JPQL/HQL/native query with the pre-calculated random value.