TargetPerEntity

Posts   
 
    
mikeg22
User
Posts: 411
Joined: 30-Jun-2005
# Posted on: 10-Nov-2005 06:01:55   

I would like to create a TargetPerEntity inheritance structure in my project. I have 4 tables that are 90% the same and would like them to derive off the same type (which is not an entity itself). In the designer, when I right-click "Entities" and click "Create target-per-entity heirarchies" nothing happens. The 4 entities are included in the project already. What could be wrong? I don't know how to create the base entity (which is not tied to a table itself), so this may be the problem.

"Make subtype of" is greyed out on each of the 4 similar entities, so I don't have this option.

EDIT: Do the related tables have to have the same PK name?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Nov-2005 09:35:50   

Their PK's have to have a 1:1 relation. Because a subtype in such a hierarchy will consist of more than one table, to be sure this works the PK's have to have the same value and thus have to have a relation of 1:1. So connect your tables with 1:1 relations. The PK names don't have to be the same but can be, that's up to you simple_smile

If your tables already have 1:1 relations with eachother over their PK's, let me know.

Frans Bouma | Lead developer LLBLGen Pro