FetchEager for ManyValuedAssociations

Out of:

Did I get it right, that FetchEager is only working correctly for Associations and not for ManyValuedAssociations?


Generates this statement:

Select ...
  from Entity a
  left join Entity2 b on (a.id = b.Entity_ID);

But property Entity.Entity2List is not Loaded, so accessing proxy-value will fire

Select ...
   from Entity2
  where Entity_ID = :p_0

Is there any possibility fetching ManyValuedAssociations to it's corresponding list in a single statement?

Well, I would say you get it right that FetchEager only causes a single SQL statement to be executed for associations and not for many-valued associations.

But both are working "correctly". Eager fetching means all associations (single and many-valued) will be loaded at the time the parent object is retrieved.

But many-valued fetching is not optimized to be in a single statement. They will still fire one SQL statement for each list.

Will these Statemens be optimized in future?

There is no current plans to do so, as this is not even possible in all scenarios. For example, if an entity has two different lists. The workaround is to query the entities from the detail part, and then eager fetch the parent objects.