Steve Ebersole commented on Bug HHH-2049

However, as we need left outer join, there is AFAIK no way to turn the fetching off, if the change for this issue is reverted. There would be no way to use Criteria and say "I want left join but not fetch". Removing fetch="join" from the mapping makes no difference. Using HQL would be the only solution. (Or am I mistaken?)

Right, I think this is exactly what I said above. The existing code tries to attribute a double meaning to joinType == JointType.LEFT_OUTER_JOIN. Reusing values to mean 2 things has consistently been a problem with legacy Hibernate code. If there are 2 values that need to be tracked, there should be 2 distinct, dedicated variables to track them. Again, that is what I am looking at doing.

And even "getting rid of the fetch" (if you mean in an automated way based on whether there is a restriction) is extremely difficult to get right in this legacy Criteria API since doing this well would need to look at nested sub-criteria as well and even potentially across sub-criterias. Much much much easier, more consistent and more explainable to say that if you have join fetching in your mapping, thats what you get (period) in a Criteria.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira