|
I've tried it and didn't work either.
I've attached a test case where you can change the version of Hibernate in the pom. The test fails with an exception like this:
org.springframework.dao.InvalidDataAccessResourceUsageException: could not prepare statement; SQL [select owner0_.id_owner as id_owner1_2_0_, dog1_.id_dog as id_anima1_0_1_, owner0_.id_company as id_compa2_2_0_, owner0_.name as name3_2_0_, dog1_1_.id_company as id_compa2_0_1_, dog1_1_.name as name3_0_1_, dog1_.breed as breed1_1_1_, dog1_.id_owner as id_owner3_1_1_ from owners owner0_ inner join dogs dog1_ on owner0_.id_owner=dog1_.id_owner and dog1_1_.id_company = ? inner join animals dog1_1_ on dog1_.id_dog=dog1_1_.id_animal where owner0_.id_company = ? and owner0_.id_owner=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not prepare statement
Where you can see the SQL.
Oddly if I change the owning side in the relationship between Owner and Dog it works.
There is a closed issue that is related to this: https://hibernate.atlassian.net/browse/HHH-8033
|