-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Subquery on Hibernate
PostPosted: Mon Aug 22, 2011 11:48 am 
Newbie

Joined: Mon Aug 22, 2011 11:15 am
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.