TreatedRoot misses fetches in query

Description

syntax like this
criteriaBuilder.treat(root, SubClass.class).fetch("subClassField", JoinType.LEFT);
is not working, since only joins are present here
https://github.com/hibernate/hibernate-orm/blob/9ff14a33c78b11f03351748dfe4a5610517325f3/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/QueryStructure.java#L308

I tried to add

to the next line and it seems to work.
Maybe it was intended and I am missing something?

Environment

None

Assignee

George Vinokhodov

Reporter

George Vinokhodov

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major
Configure