Bugs item #672639, was opened at 2003-01-23 06:08
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=672639&group_id=40712

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Simon Harris (haruki_zaemon)
Assigned to: Nobody/Anonymous (nobody)
Summary: HB2 generating incorrect join query

Initial Comment:
I have the following classes:

Party 1:1 Membership

Party joined-sub-classes Person, Company

When executing a query to find a Person, the following 
two sql statements are executed:

SELECT Membe1_.id as id0, Membe1_.versionId as 
versionId0, Perso0_.partyId as partyId1, 
Perso0_.versionId as versionId0_1, Perso0_.loginName 
as loginName0_1 FROM Party Perso0_, Person 
Perso0__1, Membership Membe1_ WHERE 
Perso0_.partyId=? and Perso0_.partyId=Membe1_.id(+)

followed by:

SELECT Membe0_.id as id, Membe0_.versionId as 
versionId FROM Membership Membe0_ WHERE 
Membe0_.id=?

Firslty, I'm not quite sure why the second query is 
generated at all but more importantly, you will notice the 
addition of an extra table in the FROM clause of the first 
query:

Person Perso0__1

Which is not needed and causes multiple results to be 
returned.

I noticed this when I submitted some patches for the 
decode stuff. I realise hb2 is still beta but I wanted to 
document it anyway. I'll look into this problem and see 
what I can find unless someone else has a slap the 
forehead DOH! moment and realises what is going 
wrong first :-)

Cheers,

Simon

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=672639&group_id=40712


-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to