[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5351?page=c...
]
Pravin Ramhari Pawde commented on HHH-5351:
-------------------------------------------
May be you are right but the difference between those queries is this[department
facility2_ is getting created extra and AND employee0_.station_id = facility2_.facility_id
is condition getting added which is the problem]. *One more thing I modified the query as
I think I cant paste same query here and I am new to this.
Extra join is getting created in Hibernate 3.5.2.
-------------------------------------------------
Key: HHH-5351
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5351
Project: Hibernate Core
Issue Type: Bug
Components: query-sql
Affects Versions: 3.5.2
Environment: Hibernate-3.5.2-Final, Oracle 10g
Reporter: Pravin Ramhari Pawde
Original Estimate: 32h
Remaining Estimate: 32h
I had written a code for hibernate verion 3.3 and was working fine.
bellow is the query::
=========================
SELECT DISTINCT employee0_.employee_id AS empl2_321_0_
FROM employee employee0_
LEFT OUTER JOIN department department1_
ON employee0_.station_id = department1_.department_id
WHERE employee0_.discriminator = 'DEPARTMENT'
AND employee0_.active = ?
AND ( department1_.department_id IN ( ?, ? )
OR department1_.parent_department_id IN ( ?, ? )
OR employee0_.station_id IS NULL )
AND ( employee0_.type_identifier IS NULL
OR employee0_.type_identifier <>? )
========================================================
After I moved to Hibernate version 3.5.2
bellow is the query::
========================
SELECT DISTINCT employee0_.employee_id AS empl2_321_0_
FROM employee employee0_
LEFT OUTER JOIN department department1_
ON employee0_.station_id = department1_.facility_id,
department facility2_
WHERE department0_.discriminator = 'DEPARTMENT'
AND employee0_.station_id = facility2_.facility_id
AND employee0_.active = 'true'
AND ( department1_.department_id IN ( ?, ? )
OR department1_.parent_department_id IN ( ?, ? )
OR employee0_.station_id IS NULL )
AND ( employee0_.type_identifier IS NULL
OR employee0_.type_identifier <>? )
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira