-->
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: Subqueries within Subqueries
PostPosted: Thu Nov 20, 2008 2:09 pm 
Newbie

Joined: Wed Sep 10, 2008 2:31 pm
Posts: 16
I have 4 detachedcriteria (A, B, C, and D)

C is a subquery of A
D is a subquery of B

It would be nice to just run a query with A = B, but I don't know how to do that within 1 query, and detachedcriteria equal to eachother.

So I thought I would just say

B is a subquery of A. Can you have a subquery within a subquery?

So far it hasn't worked, and A + C works alone, B + D works alone, A + B works alone, A + C + B - D works, but when i throw them all together (A + C + (B+D)) it implodes and gives me a NPE and doesn't show me the sql for it.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2008 3:37 pm 
Newbie

Joined: Wed Sep 10, 2008 2:31 pm
Posts: 16
seems that subqueries can go only one level deep: http://www.nabble.com/Querying-Associations-to11771664.html#a11771664

From the outside view it doesn't look all that hard to say just make it recursive, but maybe it is.

Think I might solve this through filtered mapping files.


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.