| Hibernate ORM 5.4 introduces support of RootGraphs for IdentifierLoadAccess and MultiIdentifierLoadAccess, user could specify a load graph and a graph semantic using method
MultiIdentifierLoadAccess<T> with(RootGraph<T> graph, GraphSemantic semantic);
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
if ( graphSemantic != null ) {
if ( rootGraph != null ) {
throw new IllegalArgumentException( "Graph semantic specified, but no RootGraph was supplied" );
}
loadQueryInfluencers.getEffectiveEntityGraph().applyGraph( rootGraph, graphSemantic );
}
But, this seems to be incirrect. We should check if rootGraph is null, but not otherwise. The correct version is:
if ( graphSemantic != null ) {
if ( rootGraph == null ) {
throw new IllegalArgumentException( "Graph semantic specified, but no RootGraph was supplied" );
}
loadQueryInfluencers.getEffectiveEntityGraph().applyGraph( rootGraph, graphSemantic );
}
This makes using RootGraphs with multiload impossible. |