EntityGraph in FetchGraph mode eagerly loads all sub attributes of declared main attributes

Description

Given these classes:

I query one user with the entitygraph "User.findByLogin" as FetchGraph, the profile attribute is eagerly loaded as expected.

The issue is that profile.lastModifier is also eagerly loaded.

I think that it profile.lastModifier should respect the default Profile graph and then be Lazy loaded.

Note: I also tried to define an empty Profile subgraph in "User.findByLogin" without effect. profile.lastModifier is still eagearly loaded.

Environment

JDK 7
Spring JPA
JPA 2.1

Activity

Show:
Sebastian Eichholz
June 26, 2015, 9:23 PM
Edited

Isn't this a duplicate of ? (which doesn't make it better)

Steve Ebersole
October 27, 2015, 7:16 PM

This bug report does not indicate that the reported issue affects version 5.x. Versions prior to 5.x are no longer maintained. It would be a great help to the Hibernate team and community for someone to verify that the reported issue still affects version 5.x. If so, please add the 5.x version that you verified with to the list of affected-versions and attach the (preferably SSCCE) test case you used to do the verification to the report; from there the issues will be looked at during our triage meetings.

For details, see http://in.relation.to/2015/10/27/great-jira-cleanup-2015/

Réda Housni Alaoui
October 27, 2015, 7:22 PM

Hello,

This issue can be closed.
In fact the behaviour seems normal since the object accused of eager loading was already cached in the session du to a prior query.

Steve Ebersole
October 27, 2015, 7:25 PM

Thanks for verifying!

Assignee

Unassigned

Reporter

Réda Housni Alaoui

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure