|
This is worsened by the fact that FetchType.EAGER when performed in this implicit manner does not do a JOIN fetch. Rather it does an N+1 SELECT fetch initiated by the TwoPhaseLoad mechanisms. So you (unexpectedly) get 2 different fetch behaviors:
-
Association included in EntityGraph → Eager fetch via JOIN
-
Association not included in EntityGraph but still annotated as EAGER in the @ManyToOne → Eager fetch via N+1 SELECTs
This may not be a bug, but certainly feels like unintended behavior.
|