Prefetching with Subclassed Entities

Posts   
 
    
polarbear
User
Posts: 5
Joined: 23-Oct-2006
# Posted on: 23-Oct-2006 22:53:00   

Hi,

*** resolved *** The problem was resolved, after I specified the EntityFactoryToUse also in the prefetch.Add function... I thought that specifying it once in the parent Entity was all I had to do - my bad.


I'm using LLBLGen 1.0.2005.1

Say I have two related entities, that I subclassed from the entities generated by the code. The two entities are related in basically a parent-child relation.

For example.. the parent and child entities:

MyOrderEntity : OrderEntity MyOrderDetailEntity : OrderDetailEntity

I did also create the relevant subclassed version of the corresponding factories, and i also make sure that the Constructors of MyOrderEntity will set the 'EntityFactoryToUse' of the OrderDetailEntityCollection to the one I created.

However, when I try to prefetch the MyOrderDetailEntityCollection (when fetching the MyOrderEntity), the type of the OrderDetailEntity is not my subclassed version, but the original OrderDetailEntity version. Am I doing something wrong here? or is this the intended behaviour? I would like to use my own sub-classed MyOrderDetailEntity (as opposed to the original OrderDetailEntity), as I have some customized logic and validators for the properties.

Any help is appreciated. Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 23-Oct-2006 23:30:14   

So I can mark this thread as done? simple_smile (as you specify 'resolved')

Frans Bouma | Lead developer LLBLGen Pro