| Thank you Vlad, but as far as I known EAGER collections could also be fetched by using a SELECT immediately. The difference with a LAZY SELECT is that LAZY will load the collection only if the proxy gets invoked. That is:
- LAZY triggers a FetchStrategy with FetchTiming.DELAYED and FetchStyle.SELECT;
- EAGER triggers a FetchStrategy with FetchTiming.IMMEDIATE and a FetchStyle which could be JOIN, SELECT or SUB_SELECT.
You can annotate any EAGER collection with @Fetch(SELECT) to have it loaded with a SELECT, but in AbstractEntityGraphVisitationStrategy the EAGER fetch style is hard-coded to JOIN and in my opinion it should rather respect the annotated one (if present), to avoid pagination performance issues and let multiple bags included in the graph. |