Forward mapping with base entity that defines identity

2 posts, 0 answers
  1. Roderik
    Roderik avatar
    4 posts
    Member since:
    Feb 2008

    Posted 08 Nov 2011 Link to this post

    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,
  2. Ivailo
    Ivailo avatar
    318 posts

    Posted 11 Nov 2011 Link to this post

    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,
    the Telerik team

    NEW and UPDATED OpenAccess ORM Resources. Check them out!

  3. DevCraft banner
Back to Top