| For example, running org.hibernate.jpa.test.graphs.queryhint.QueryHintEntityGraphTest#testLoadGraph multiple times, the generated SQL can be either of the following:
select
company0_.id as id1_0_0_,
location2_.id as id1_8_1_,
company0_.location_id as location2_0_0_,
markets1_.Company_id as Company_1_2_0__,
markets1_.markets as markets2_2_0__,
location2_.address as address2_8_1_,
location2_.zip as zip3_8_1_
from
Company company0_
left outer join
Company_markets markets1_
on company0_.id=markets1_.Company_id
left outer join
Location location2_
on company0_.location_id=location2_.id
or
select
company0_.id as id1_0_0_,
location1_.id as id1_8_1_,
company0_.location_id as location2_0_0_,
markets2_.Company_id as Company_1_2_0__,
markets2_.markets as markets2_2_0__,
location1_.address as address2_8_1_,
location1_.zip as zip3_8_1_,
markets2_.Company_id as Company_1_2_0__,
markets2_.markets as markets2_2_0__
from
Company company0_
left outer join
Location location1_
on company0_.location_id=location1_.id
left outer join
Company_markets markets2_
on company0_.id=markets2_.Company_id
Notice that in the second statement, the following SELECT expressions are duplicated:
markets2_.Company_id as Company_1_2_0__,
markets2_.markets as markets2_2_0__,
I see the same issue for #testLoadGraphOrderByWithImplicitJoin and #testLoadGraphWithRestriction. The repeated expressions all involve the table, Company_markets, for Company#markets. I believe repeated column aliases may cause problems with some dialects. |