-->
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: Inner query with cross join or inner-inner query ???
PostPosted: Thu Sep 08, 2005 4:39 am 
Newbie

Joined: Thu Sep 08, 2005 2:43 am
Posts: 6
Hibernate version: 2

I am trying to write a HQL query with an inner query. It works fine until I try with a cross join, like this:

... WHERE o1.prop1 IN (SELECT c1.prop2 FROM Class1 c1, Class2 c2 WHERE ...)

or an inner query inside my first inner query, like this:

... WHERE o1.prop1 IN (SELECT c1.prop2 FROM Class1 c1 WHERE c1.prop3 IN (SELECT c2.prop4 FROM Class2 c2 WHERE ...))


But I'll get a parse exception :(
In both cases it does not seem to resolve the second classname and the message is (for example)

in expected: c2 [select ... from my.package.Class0 as o1 where o1.prop1 in (select c1.prop2 from my.package.Class1 c1 where c1.prop3 in (select c2.prop4 from Class2 c2))]

So... any suggestions please? Is it not supported with this kind of query?


Top
 Profile  
 
 Post subject: Gah...! stupid me...
PostPosted: Thu Sep 08, 2005 5:04 am 
Newbie

Joined: Thu Sep 08, 2005 2:43 am
Posts: 6
Gah...! stupid me...
I had fotgotten to add the class to the SessionFactory... sorry guys.

Problem solved :-)


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.