I have some like this
Code:
select object1, object2.data, object3.data
from Object object1
left join fetch object1.object2 as object2
left join fetch object1.object3 as object3
order by object2.data, object3.data
I've included data from object2 and object3 because I need them for the order by clause,
but I only want the object1
I can't do something like
Code:
select object1
from (select object1, object2.data, object3.data
from Object object1
left join fetch object1.object2 as object2
left join fetch object1.object3 as object3
order by object2.data, object3.data ) as query
because hibernate doesn't accept ! so how I can do this?