Using LLBLGen 3.1 (April 14th, 2011), Sql Server, Adapter .NET 3.5.
I'm having trouble with the following situation, i have a many to many relationship between two entities (Item, Order), the table for the relationship is OrderHasItem. While fetching Items I'm trying the get orders for an item with all the items on those orders as well, so it's kind of a circural prefetch path.
eg. pfpItem.Add(ItemEntity.PrefetchPathOrderHasItem). SubPath.Add(OrderHasItemEntity.PrefetchPathOrder). SubPath.Add(OrderEntity.PrefetchPathOrderHasItems). SubPath.Add(OrderHasItemEntity.PrefetchPathItem);
The problem:
In this situation my Orders have an extra OrderHasItem entity that is related to the original Item.
eg. One order with two Items in the database, starting from Item1 using the PrefetchPath from above gives:
-Item1 has one OrderHasItem entity that ofc has an Order on in, the Order has 3 OrderHasItem entities!!
I'm attaching a simple repro solution thats a small console app and DB scripts, run the two sql scripts and run the console app to reproduce the problem.
I'm sure this in not so by design and my current workaround is to remove the extra OrderHasItem entity from the Order, but when working with a lot of data this is slowing things down.
Attachments
Filename |
File size |
Added on |
Approval |
MTMRepro.llblgenproj
|
12,797 |
20-May-2011 12:23.13 |
Approved |