I have a query which returns a list of objects like such:
select distinct ref from references where [...]
I'd like to order these by a field not on ref but on an association of ref, i.e.:
select distinct ref from references where [...] order by ref.foo.name
Unfortunately this doesn't work in Oracle (once the query is translated to SQL) since it can only sort on this column if it's included in the select. Is there any way I can return the column as well, without hibernate actually picking it up? I'd like to just return a List instead of having to muck about with the Object[] arrays it would otherwise return.