| Performing a descending order by on a composite field generate the incorrect SQL for the query. For example:
session.createQuery("from SampleTable order by someCompositeField desc").getResultList();
This will return the incorrect SQL: select s.* from SampleTable s order by someCompositeField.arg1, someCompositeField.arg2 desc Whereas I'd expect the SQL to be: select s.* from SampleTable s order by someCompositeField.arg1 desc, someCompositeField.arg2 desc I've attached a test case to demonstrate the problem. This looks to be have been raised, and closed before as
HHH-7025 Closed . I have a fix for the org.hibernate.dialect.Dialect class, modifying the renderOrderByElement(...) method, and will raise a pull request for it soon. Thanks |