This is a migrated thread and some comments may be shown as answers.

Forward mapping with base entity that defines identity

1 Answer 43 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Roderik
Top achievements
Rank 1
Roderik asked on 08 Nov 2011, 11:25 PM
When using forward mapping, is it possible to define a base entity which provides, among other fields, the identity for all other classes. I am getting errors that no primary key is set while I DID define the implemented field as Identity (see screenshot).

I got this working with fluent mapping by defining the BaseEntity with horizontal mapping and then setting the identity on the mapping of each of the implementation classes. 

Please see attached screenshots with the errors the designer is giving me. 

Kind regards,
Roderik 

1 Answer, 1 is accepted

Sort by
0
Ivailo
Telerik team
answered on 11 Nov 2011, 02:21 PM
Hi Roderik,

This is just something particularly valid for the Visual Designer mapping - the horizontal inheritance requires each of the classes to have it's own primary key (ID) explicitly defined. What you can do if you would like several classes to use the primary key property of the base class, we can recommend you the vertical inheritance

Do not hesitate to let us know if you need any clarification or you have other questions.

All the best,
Ivailo
the Telerik team

NEW and UPDATED OpenAccess ORM Resources. Check them out!

Tags
Design Time (Visual Designer & Tools)
Asked by
Roderik
Top achievements
Rank 1
Answers by
Ivailo
Telerik team
Share this question
or