Hibernate doesn't load attribute nodes with entity graph

1 week ago 5
ARTICLE AD BOX

I have the next entity three:

TestEntity / \ FirstNodeEntity SecondNodeEntity (LIST, LAZY) (LIST, LAZY) | \ ThirdNodeEntity FinalNodeEntity (LIST, LAZY) (LIST, LAZY) | SecondNodeEntity (One element, LAZY)

I am using spring 3.5.x version with spring data (hibernate) with cosium jpa entity graph lib to build query with appropriate graph. Graph structure:

TestEntityEntityGraph. .____() .firstNodeList().thirdNodeList().secondNodeElement().finalNodeList() .____ .secondNodeList().finalNodeList() .____ .____();

And the problem is the final node elements are not loaded at all. I enabled hibernate logs by spring.jpa.hibernate.properties.hibernate.show_sql=true and don't see any sql queries related to the final node element. So it's initialized with LAZY (as proxy) but I don't expect it...though others are initialized as expected. Even second node elements are initialized.

And one interesting thing is...when I comment .firstNodeList().thirdNodeList().secondNodeElement().finalNodeList() it works as expeted...there are all elements in context.

What can be wrong? I don't have any hibernate speicifc configuration at all. All associations have LAZY fetch type and default Fetch mode

Read Entire Article