SQL ORDER BY RANDOM
Introduction In this article, we are going to see how we can sort an SQL query result set using an ORDER BY clause that takes a RANDOM function provided by a database-specific function. This is a very handy trick, especially when you want to shuffle a given result set. Note that sorting a large result set using a RANDOM function might turn out to be very slow, so make sure you do that on small result sets. If you have to shuffle a large result set and limit it afterward, then it’s… Read More
How to order entity subclasses by their class type using JPA and Hibernate
Introduction In this article, we are going to see how to order entity subclasses when executing a JPA query with Hibernate.