Hi folks. Want to see if anyone knows a solution to a problem we're having.
Part of our object model consists of a 'root' table named 'Usage.' it is generated as an Abstract class. There are ~40 Entities that derive from this base class (referred to as 'Usage Leaf' entities.) Usages are part of a larger entity, called a 'RoofAssembly,' and a RoofAssembly entity has 1-N Usages, of any of the available subtypes.
If we set up a regular Prefetch, the polymorphic prefetch feature works as expected- it will pick up all of the Usage Leaf subtypes correctly. Our problem is, there are a lot of Leaf tables to check, and some of the tables have tens of millions of rows. We end up with very long-running queries.
In the past, we worked around this by specifying an EntityFactory for the Prefetch path- this would result in only a single Leaf table being queried, in a sort of load-on-demand strategy. However, due to a change in requirements
, we now need to load up the entire hierarchy at once.
What I was looking for was a way to pass a list of IEntityFactory2's to the Prefetch. Along the lines of "Do a polymorphic prefetch, but I only want to get these 5 Leaf types back, and ignore all other types that derive from Usage." I tried adding 'duplicate' Prefetch elements, each using a different Factory, but that threw an exception.
So... Anyone have suggestions on how to do this?
Thanks much.