I am using both hibernate and spring in my application.
I am looking for a way to query the database and return a few random entries from a table. For example, suppose i ahve a table called 'user'. I want to be able to retrieve 3 users at random from that table. How can this be accomplished using hibernate?
I have looking into the HQL language but could not find anythign that could help me. The best i can think of is retrieving the max(id) and min(id), have a random number generator between max and min, and use the get(id) command.
Your help is appreciated. What is the best way I can accomplish this. Thank you.


Reply With Quote