[JIRA] (HHH-14034) session.byMultipleIds().with( <graph> ) ignores the provided graph
by Yoann Rodière (JIRA)
Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMWIxNTE5NDRk... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14034?atlOrigin=eyJpIjoiMWIxNT... ) HHH-14034 ( https://hibernate.atlassian.net/browse/HHH-14034?atlOrigin=eyJpIjoiMWIxNT... ) session.byMultipleIds().with( <graph> ) ignores the provided graph ( https://hibernate.atlassian.net/browse/HHH-14034?atlOrigin=eyJpIjoiMWIxNT... )
Change By: Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
As far as I can tell, the graph mentioned in the code below will always be ignored:
{code}
session.byMultipleIds( Parent.class )
.with( (RootGraph) session.getEntityGraph( "eager" ), GraphSemantic.FETCH )
.multiLoad( 1, 2, 3 );
{code}
This ticket may be a duplicate of HHH-12818, 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: https://github.com/yrodiere/hibernate-orm/tree/multiload-graph
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, with my implementation, 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}}.
( https://hibernate.atlassian.net/browse/HHH-14034#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14034#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100127- sha1:9440fb1 )
5 years, 10 months