-->
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.  [ 5 posts ] 
Author Message
 Post subject: Left join in nested query: BUG with Hibernate 3
PostPosted: Fri Jun 03, 2005 5:42 am 
Regular
Regular

Joined: Thu Sep 04, 2003 10:43 am
Posts: 61
The following query:

FROM it.saga.pubblici.tributi.TriDACCalcoloVoci as voce WHERE voce.pkid IN
(SELECT v.pkid FROM it.saga.pubblici.tributi.TriDACCalcoloVoci as v
LEFT JOIN v.sottoPeriodo as sp)

do not work with Hibernate 3.0.3 and SQL Server, while it worked with Hibernate 2.1.6 and the same DB.

The bug is in the translation from HQL to SQL because the result SQL query is:

select [omississ] from TRI_CALCOLO_VOCI tridaccalc0_ where tridaccalc0_.pkid in
(select tridaccalc1_.pkid from TRI_CALCOLO_VOCI tridaccalc1_,
left outer join TRI_CALCOLO_SOTTOPERIODO tridaccalc2_ on tridaccalc1_.id_sottoperiodo=tridaccalc2_.pkid)

The problem is that comma (,) just before the LEFT OUTER JOIN: that comma must not be there at all!
If I change my query and use a INNER join the comma (,) is ok, and so the query works perfectly ... but, of course, I can't do that.
Moreover if the nested query is executed alone (i.e. SELECT v.pkid FROM it.saga.pubblici.tributi.TriDACCalcoloVoci as v LEFT JOIN v.sottoPeriodo as sp) it works!

Is this a known bug?
Can anybody tell me when is going to be solved?

Tell me if you need more information (mappings or things like this ... I did not send them because they are quite complex ... and I think you can easlily reproduce the bug).

Regards
Alessandro Rizzi


Top
 Profile  
 
 Post subject: Re: Left join in nested query: BUG with Hibernate 3
PostPosted: Fri Jun 03, 2005 6:00 am 
Regular
Regular

Joined: Thu Sep 04, 2003 10:43 am
Posts: 61
I tried just now with Hibernate 3.0.5 and I have the same bug.
Alessandro


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 9:36 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
please post in to JIRA

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 10:37 am 
Regular
Regular

Joined: Thu Sep 04, 2003 10:43 am
Posts: 61
emmanuel wrote:
please post in to JIRA


Done, the key is HHH-577
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 30, 2005 10:54 am 
Regular
Regular

Joined: Thu Sep 04, 2003 10:43 am
Posts: 61
arizzi wrote:
Done, the key is HHH-577
Thanks


Gavin says this is a duplicate of another bug, and I supposed it's the HHH-554, so I download from CVS version 3.1 alfa which solves this bug, but I still have it.

I think my problem is a little different because I have it only with nested subqueries, not with simple query.

Do you need a full test case?

Thanks for help
Alessandro


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.