Does anyone have HQL query on how to get list of 10 random unique objects from the database?
It should be done in database not in application. I’d like to get something that has better performance than my current solution which pretty much makes 10 requests to get the list filed up.
I’m no HQL expert by any means, but in SQL you would do this with
So with a bit of googling, I figured out how to do the limit bit and the random bit.