syntax like this
criteriaBuilder.treat(root, SubClass.class).fetch("subClassField", JoinType.LEFT);
is not working, since only joins are present here
I tried to add
to the next line and it seems to work.
Maybe it was intended and I am missing something?
Looks like an oversight.
I know you're familiar with treat, what's your take on this?
could you prepare a test case using our test case template (https://github.com/hibernate/hibernate-test-case-templates/tree/master/orm/hibernate-orm-5)? Or even prepare a PR?
Indeed, this seems to be an oversight and your fix looks reasonable.
I'll try to add a test
Opened pull request