As @stliu commented here:
/**
* The JPA 2.1 SPEC's Entity Graph only defines _WHEN_ to load an attribute, it doesn't define _HOW_ to load it
* So I'm here just making an assumption that when it is EAGER, then we use JOIN, and when it is LAZY, then we use SELECT.
*
* NOTE: this may be changed in the near further, though ATM I have no idea how this will be changed to :)
* -- stliu
*/
protected static final FetchStrategy DEFAULT_EAGER = new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.JOIN );
the SPEC doesn't define HOW to load (JOIN or SELECT) and he's making his assumption on JOIN, but this fails with multiple collections in the graph and makes pagination impossibile for large tables. Also, it seems that setting the HINT_FETCHGRAPH on the query does not trigger the FetchGraphLoadPlanBuildingStrategy at all. I asked about that to @stliu and @brmeyer on Gitter, hope they could comment on that. |