I think if there is a alias used in the top query and no alias used in the sub query, then the auto interpretation should be that the id attribute if used as such (id.queryId) should belong to the subquery right?
Well, it’s a 50:50 thing. Some people are going to argue for one or the other interpretation. We chose the sensible way, which is to throw an error if there is an ambiguity. It wasn’t really defined what Hibernate 5 did in this case, so maybe it was doing the wrong thing for you all along! Be happy that you can now disambiguate this matter by introducing aliases like you should have done in the first place. |