Hibernate ORM 5.4 introduces support of RootGraphs for IdentifierLoadAccess and MultiIdentifierLoadAccess, user could specify a load graph and a graph semantic using method {code:java} MultiIdentifierLoadAccess<T> with(RootGraph<T> graph, GraphSemantic semantic); {code} When query is executed, we check if GraphSemantic is present. If it is set but no load graph was supplies exception is thrown. (SessionImpl:2851, SessionImpl:3050 ). Currently this code looks like
{code:java} if ( graphSemantic != null ) { if ( rootGraph != null ) { throw new IllegalArgumentException( "Graph semantic specified, but no RootGraph was supplied" ); } loadQueryInfluencers.getEffectiveEntityGraph().applyGraph( rootGraph, graphSemantic ); } {code} But, this seems to be incirrect incorrect . We should check if rootGraph is null, but not otherwise. The correct version is:
{code:java} if ( graphSemantic != null ) { if ( rootGraph == null ) { throw new IllegalArgumentException( "Graph semantic specified, but no RootGraph was supplied" ); } loadQueryInfluencers.getEffectiveEntityGraph().applyGraph( rootGraph, graphSemantic ); } {code}
This makes using RootGraphs with multiload impossible.
|
|