-->
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: How to deal with: left outer join ( A join B on xxx ) on yyy
PostPosted: Fri Sep 12, 2008 12:16 pm 
Newbie

Joined: Thu May 24, 2007 4:13 am
Posts: 4
Location: Lyon (France)
Hibernate version: 3.2.5

Im trying to figure out how to write a HQL query generating a SQL like ;
Code:
select T.key, B.key from T left outer join ( A join B on xxx ) on yyy

(the key property is just an sample; I actualy get a name and a number of documents for a report)

Context
The aim is to have access to this structure :
T : the "master" table
A : is associated to Tabe but not mandatory (in T)
B : is associated to A

The path si something like
T -> A -> B
I need to get the Object from T and from B (or null)

I tried many HQL, they all failed.
ex:
Code:
select T.key, B.key from T left join (t.a A join A.b B with xxx) with yyy


Questions
Is it a kind of sql query that Hibernate can generate?
How to write the correcponding HQL?[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 12, 2008 5:50 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
As far as I know, "Common table expressions" (CTE) and the WITH keyword are not supported in Hibernate.

You can probably achieve the same result by using a subquery, or by joining all the involved tables at the same level.

_________________
Gonzalo Díaz


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.