Jmix 2.1.1
I have a standard detail view for an Entity that contains multiple association fields for the same Member
type. I want the loading of the screen to be as efficient as possible, so I am listing those child properties in the fetch plan of the InstanceContainer. Also, studio warns the properties are not included in the fetch plan if I don’t do this. I was hoping they would be loaded eagerly with the main query and only retrieve the _instance_name columns, but both of those things are not happening.
Problem 1
It appears to only use the fetch plan for the first child property and ignores the rest. For example, the following definition will use _base for fetching all 7 Member
entities:
<instance id="memberPromotionDc" class="org.ajjf.membership.entity.MemberPromotion">
<fetchPlan extends="_base">
<property name="member" fetchPlan="_base"/>
<property name="examiner1" fetchPlan="_instance_name"/>
<property name="examiner2" fetchPlan="_instance_name"/>
<property name="examiner3" fetchPlan="_instance_name"/>
<property name="examiner4" fetchPlan="_instance_name"/>
<property name="caller" fetchPlan="_instance_name"/>
<property name="uke" fetchPlan="_instance_name"/>
</fetchPlan>
<loader/>
</instance>
Question / Problem 2
Should a detail view be able to load associated entities eagerly? No matter what I try the InstanceContainer always loads them in separate queries. This approach does work for standard list views and CollectionContainers.
Thanks!