-->
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.  [ 2 posts ] 
Author Message
 Post subject: HQL: Selecting Children w/out a Parent?
PostPosted: Tue Apr 06, 2004 8:38 pm 
Regular
Regular

Joined: Wed Dec 17, 2003 1:58 pm
Posts: 102
Situation:
Parent has a Set with a Many-to-Many relationship with Children. It's one way. IE the child does not have a link to his parent (don't ask why, this is just the situation :P)

How could I use HQL or Criteria to select children that are not a member of ANY parent's set?

I tried:
Code:
from Child c, Parent p where c not in elements(p.children)


however MYSQL through an error on that.. and I tend to think that would return a multi dimensional List? Is this Query possible?

Thanks!
-David


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 07, 2004 1:57 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
if you only want chidl to be returned:
Code:
select c from Child c, Parent p where c not in elements(p.children)


try to take a look at "size" on element... may help


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

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.