[hibernate-issues] [JIRA] (HHH-14034) session.byMultipleIds() ignores the provided graph

Yoann Rodière (JIRA) jira at hibernate.atlassian.net
Wed May 20 09:47:37 EDT 2020


Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZmMxMGUyNzExNTRhNDRmOTgxZmI5N2E5ZWU5Njc0N2QiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14034?atlOrigin=eyJpIjoiZmMxMGUyNzExNTRhNDRmOTgxZmI5N2E5ZWU5Njc0N2QiLCJwIjoiaiJ9 ) HHH-14034 ( https://hibernate.atlassian.net/browse/HHH-14034?atlOrigin=eyJpIjoiZmMxMGUyNzExNTRhNDRmOTgxZmI5N2E5ZWU5Njc0N2QiLCJwIjoiaiJ9 ) session.byMultipleIds() ignores the provided graph ( https://hibernate.atlassian.net/browse/HHH-14034?atlOrigin=eyJpIjoiZmMxMGUyNzExNTRhNDRmOTgxZmI5N2E5ZWU5Njc0N2QiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.4.16 Assignee: Unassigned Components: hibernate-core Created: 20/May/2020 06:47 AM Fix Versions: 5.4-backlog Priority: Major Reporter: Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b )

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 ( https://hibernate.atlassian.net/browse/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.

( https://hibernate.atlassian.net/browse/HHH-14034#add-comment?atlOrigin=eyJpIjoiZmMxMGUyNzExNTRhNDRmOTgxZmI5N2E5ZWU5Njc0N2QiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14034#add-comment?atlOrigin=eyJpIjoiZmMxMGUyNzExNTRhNDRmOTgxZmI5N2E5ZWU5Njc0N2QiLCJwIjoiaiJ9 )

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.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100127- sha1:9440fb1 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200520/c92d1845/attachment.html 


More information about the hibernate-issues mailing list