Hibernate Query Language (HQL) is an easy-to-read and powerful query language designed as an object-oriented extension in SQL that closes the gap between object-based systems and interactive websites. The HQL syntax is very similar to the SQL syntax.
HQL queries are easy to understand and use persistent class words and structures instead of table names and columns. HQL contains the following features.
ORDER BY clause is used to sort the HQL query's results. You can order the results by any property on the object set, either ascending (ASC) or descending (DESC).
String hql = "FROM Employee E WHERE E.id > 10 ORDER BY E.salary DESC";
Query query = session.createQuery(hql);
List results = query.list();
If you wanted to filter by more than one layout, you could add additional features at the end of the order in a paragraph, separated by commas as follows -
String hql = "FROM Employee E WHERE E.id > 10 " +
"ORDER BY E.firstName DESC, E.salary DESC ";
Query query = session.createQuery(hql);
List results = query.list();