In HHH-2772 the check for non-driving table references got removed, but the sql generated for the table reference is wrong when comparing *ToOne relations there are cases possible now that shouldn't be . The following HQL should fail
{code:sql} FROM EntityA a JOIN EntityB b ON owner1 = a.owner = JOIN b.owner owner 1 {code}
will roughly result but instead results in something like the following SQL
{code:sql} SELECT ... FROM entity_table_a a JOIN entity_table_b b ON owner_3 = b a .owner_id JOIN owner_table owner_3 ... {code}
The *owner_3* alias is This SQL fails, but IMO Hibernate shouldn't even be able to compile the faulty alias generated for the non-driving table reference HQL . |
|