Message:
The following issue has been re-assigned.
Assignee: Gavin King (mailto:ga...@in...)
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-151
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-151
Summary: Traversing several joined-subclasses in where clause leaves out inner joins
Type: Bug
Status: Assigned
Priority: Critical
Project: Hibernate2
Components:
core
Versions:
2.0.1
Assignee: Gavin King
Reporter: Christian Bauer
Created: Tue, 8 Jul 2003 3:32 PM
Updated: Tue, 8 Jul 2003 6:57 PM
Environment: WSAD 5.0.1, JDK 1.3.1, Oracle 9i, Windows 2000
Description:
Class-diagram:
a-->b a inherits from b
a==b a has relationship to b
(Sorry, classnames are in Dutch)
Persoon == Beroepsuitoefening
Beroepsuitoefening <-- Jurist
Jurist == Bevoegdheid
Bevoegdheid <-- Beediging <-- Procureurschap
If my query contains 'where jurist.persoon.naam like ?', the generated SQL looks like this
(which is OK):
select count(*) as x0_0_
from jurist persiste0_
inner join beroepsuitoefening persiste0__1 on persiste0_.beg_id=persiste0__1.id,
persoon persiste1_
where (
(
persiste1_.naam like ?
and persiste0__1.psn_id=persiste1_.id
)
)
However, if I start one level deeper in the hierarchy ('where
procureurschap.jurist.persoon.naam like ?') the SQL query looks like this:
select count(*) as x0_0_
from procureurschap persiste0_
inner join beediging persiste0__1 on persiste0_.bvh_id=persiste0__1.bvh_id
inner join bevoegdheid persiste0__2 on persiste0_.bvh_id=persiste0__2.id,
jurist persiste1_,
persoon persiste2_
where (
(
persiste2_.naam=?
and persiste0__2.beg_id=persiste1_.beg_id
and persiste1__1.psn_id=persiste2_.id
)
)
[Queries are indented to show outline]
As you can see, the last clause references persiste1__1, which isn't listed in the from
clause. It's intended to, because the pattern matches with the previous example (_1 begin
the first innerjoin for persiste1_). It should be an alias for beroepsuitoefening just as it
is in the previous example.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|