Duplicate SQL joins

Description

Next HQL generate duplicate joins for mother table:

select a
from cat as a
join a.mother <= generates first sql join with mother table
where a.mother.name='Kitty' <= generates second sql join mother table

Same problem with this:

select a
from cat as a
join a.mother b <= generates first sql join with mother table
where a.mother.name ='Kitty' <= generates second sql join mother table

In 3.3 version detect joins name/alias used in where to avoid duplicated sql joins

Of course, forcing alias usage remove duplicate sql joins

select a
from cat as a
join a.mother b
where b.name ='Kitty'

Environment

On Ubuntu Linux with H2/Sybase databases

Activity

Show:
Brett Meyer
October 29, 2013, 4:15 PM

Please provide a test case that reproduces this issue – thanks!

Brett Meyer
December 19, 2013, 10:31 PM

Note: In an attempt to clean up the HHH JIRA, we will be rejecting any ticket that sits in the "Awaiting Test Case" state for 2-3 months with no response. So, if this issue is critical to you, please attach a reproducing test case ASAP. Thanks!

Brett Meyer
March 3, 2014, 3:40 PM

Bulk rejecting issues lacking a test case or recent response.

Assignee

Unassigned

Reporter

Jose Illescas

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure