| When I use a criteria and then join entities that have properties with an @OrderBy annotation, Hibernate always creates an order by clause for this property. This leads to issues on MS SQL Server as order by properies also need to be included when distinct projections are used:
Especially when the criteria object is assembled dynamically, the ability to manipulate the distinct projection is often not provided, so the idea is to be able to temporarily disable @OrderBys in some conditions. Thanks in advance for an answer. |