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: HQL help needed
PostPosted: Sat May 29, 2004 9:37 am 
Newbie

Joined: Sat Mar 20, 2004 9:05 am
Posts: 5
Hi all, does anyone know the proper hql for the following?
Class A has a collection of Class B mapped in a middle table. I want to get all B that aren't in any collection in A, basically all B that don't appear in the middle table.
I can do it be getting all the id's for B that are in the middle table and then selecting all B's who's id's don't appear in the previous select.
However, when I try to get the B's in the middle table using the following:

select distinct b.id from B as b, A as a join a.collectionOfBs as bs
I get all instances of B even if they don't appear in the middle table at all.

What's the hql equivalent of:

join a_b_middletable on b.id=a_b_middletable.b_id

Thanks in advance,

M@


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.