| For the record, I will repeat what I said on twitter. I just read the JPA 2.1 specification. Entity graphs are query hints. Query hints can be passed to any CriteriaQuery. There is not a single line that says that they cannot be applied to CriteriaQuery using multiselect. So my conclusion is that multiselect CriteriaQuery should also follow the fetch graphs, aka the relationship laziness. Even if I am wrong on the interpretation of the specification, my expectations are as follow. The relation is optional and lazy. At best, I expect Hibernate to not join at all on the foreign table. At worst, I expect Hibernate to perform an outer join. Projections with lazy loaded entities allow to build views quickly. I think this ticket should be at least reopened as an improvement. Thank you for your time. |