I'm using PostgreSQL and what I need to do is to perform a random SELECT query from a certain table in my database (via Hibernate).
What would be the best way of achieving this?
Here is my code so far:
criteria.addOrder(Order.asc("RANDOM()"))
where RANDOM() is the PostgreSQL function. However, there is no property with such a name in the Entity class, and therefore, a HibernateException gets thrown.