| As far as I can tell, the graph mentioned in the code below will always be ignored:
session.byMultipleIds( Parent.class )
.with( (RootGraph) session.getEntityGraph( "eager" ), GraphSemantic.FETCH )
.multiLoad( 1, 2, 3 );
This ticket may be a duplicate of HHH-12818 Open , but honestly I can't bring myself to consider this as an "improvement" since the API to specify an entity graph already exists (but is apparently non-functional). Here is a branch with a reproducer: I also tried to start working on a fix, but this turned out to be more complex than initially anticipated. In particular:
- for some reason, fetch graphs apparently don't reset eager associations to lazy;
- the implementation of load graphs seem to be specific to parsed HQL queries (see org.hibernate.engine.query.spi.EntityGraphQueryHint#toFromElements, org.hibernate.hql.internal.ast.HqlSqlWalker#processQuery), and I'm not sure how to copy that implementation to org.hibernate.loader.entity.DynamicBatchingEntityLoaderBuilder.DynamicEntityLoader.
|