I would have thought this is a common requirement but I just cannot seem to find any resources addressing this. I have several Entities defined along with Associations between them. They deploy without errors and I am able to create an External List against my primary Entity. We viewing (ReadItem) or editing a specific item (Update), the Association works and displays the "lookup" value instead of the foreign key value.
Obviously I need to extend this to the initial list of items (ReadList) but cannot seem to find any way to do this. Since Association values are found by executing separate queries, doing so for a single Entity does not cost much in terms of performance.. However, doing so for a list of items would be painful since you would have one query for the list and then (number of list items * number of associations) queries for the supporting values.
The usual way of solving this is to have the list query also perform LEFT JOINs to bring back all the data at once. Then instead of display say StatusId or ProductId you would display the actual Status value (New, Open, etc.) or the Product Name.
In essence you need to completely flatten the object returned by ReadList. Once the query is modified you can then add additional TypeDescriptors to represent the lookup properties. The problem is that while the ReadItem object can contain TypeDescriptors that other methods do not have, the opposite is not true. You cannot have TypeDescriptors in the ReadList method that do not also exist in the ReadItem method.
The only solution (that I can think of) to that is to flatten the model all the way throughout the Entity. So now all my methods (or at the very least ReadItem and ReadList) have both the foreign key Type Descriptor and the lookup value Type Descriptor. Obviously I do not want that displayed on the View Item and Edit Item views.
While I can set the Read-Only property of the lookup value Type Descriptor to True so it does not display in the Edit page I do not see any property to hide it on the View page. I am sure I can then use SPD to modify the page to hide the unwanted properties but this seems like a very convoluted and complex way of solving a very, very common requirement. (After all, I cannot think of any scenario where you define Associations between Entities but are ok with the not showing the Association on the List view.)
How is this normally dealt with?
Thank you.