Brett Meyer commented on an issue
Hibernate ORM / Bug HHH-7638
HQL Cashing
When I do a HQL query as:

SELECT count(*) FROM table WHERE property = 'value'

and right afterwards I do:

FROM table WHERE property = 'value' ORDER BY other.property

the resulting rows won't be ordered if I activate cashing and use the same query-cash-region. If I include the ORDER BY clause to the first statement, everything is fine.