No objectsets when using Table Per Type inheritance

Posts   
 
    
chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 07-Mar-2011 17:31:37   

Hi all,

i am using LLBLGen Pro 3.1, MS SQL Server 2008 R2, Visual Studio 2010 (all project based on .Net 4.0), entity framework 4.0.

After a few month working on a project we today start to integrate Table Per Type inheritance. I started with an easy three steps hierarchy.

When i generated the code i wondered, where the objectsets are. One has been generated for the BaseClass but not more. Is this OK?

regards

chris

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Mar-2011 18:01:21   

please give more info, e.g. by attaching a repro project, or descriptions of what you got and what you expected.

Frans Bouma | Lead developer LLBLGen Pro
chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 07-Mar-2011 18:30:42   

hi otis,

as i just shut down my pc i will come with further informations tomorrow.

regards

chris

chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 08-Mar-2011 11:07:48   

hi otis,

here i am back again. now, what i have is:

BASE_ENTITY

ENTITY_A_1 : BASE_ENTITY

ENTITY_B_1 : ENTITY_A_1

ENTITY_A_2 : BASE_ENTITY

ENTITY_B_2 : ENTITY_A_2

i use TABLE PER TYPE inheritance. now, in the generated code for the ms entity framework i expect, beside all other things, 5 ObjectSets (in the dbcontext):

ObjectSet<BASE_ENTITY> BASE_ENTITYS ObjectSet<ENTITY_A_1> ENTITY_A_1s ObjectSet<ENTITY_A_2> ENTITY_A_2s ObjectSet<ENTITY_B_1> ENTITY_B_1s ObjectSet<ENTITY_B_2> ENTITY_B_2s

but in the loop header of the loop generating the corresponding code, i can see:

foreach(EntityDefinition entity in _executingGenerator.Entities.Where(e => !e.IsSubType && !e.IsPureManyToManyIntermediate).OrderBy(e => e.Name))

so, for subtypes no entitysets are generated. but why?

thanx in advance,

regards

chris

chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 08-Mar-2011 12:43:34   

ok, sometimes it is better to read and think first. LLBLGen just does it right, for subtypes there a no objectsets created. i mark this thread as answered.

thanx and regards,

chris