Search code examples
hibernatehql

Does Hibernate HQL Select preserve the table's order?


does the Hibernate Query Language preserve the row order in the query result when using a simple "select" with no "order by"? Is it ok to rely on the order returned to assume the result contains the row in the order of creation?

thanks in advance for your help.


Solution

  • In my opinion you should never rely on the row order of the database. If your application need rows in a certain order, use order by no matter what.