Vertical Inheritance and Extraneous Id Column

2 posts, 0 answers
  1. Chris
    Chris avatar
    3 posts
    Member since:
    Nov 2012

    Posted 07 Jul 2013 Link to this post

    Hi,

    I've got a very simple model which I'm trying to design.  As part of it, I want to have a PostalLocation base entity which contains the fields:

    Id
    Name
    Address1
    Address2
    Address3
    County
    Postcode
    Country

    Now, I want to have any other models which include postal data to inherit from this class.  For example, a CustomerSite entity.

    This seems pretty straightforward, following this guide.  I've created the CustomerSite entity and removed its automatically-generatedId column.  Then I've added the inheritance via the toolbox and set the inheritance strategy to Vertical.

    So far, so good.  No warnings in Visual Studio's list.  So, I go ahead and choose to update the database from the model.  I start with an empty database and run the script which OpenAccess generates.

    That's where the problem starts.  Now, VS reports this warning:

    Warning 1   The column with name 'Id' is not mapped to a property.  C:\Users\Chris\Documents\Visual Studio 2012\Projects\OATest\OATest.DAL\EntitiesModel.rlinq    0   0  

    It seems that the script has generated an Id column in the database for my derived entity, which according to the docs I shouldn't have.

    Unfortunately, this error prevents me from creating the service via the Add OpenAccess Service menu option (the entities aren't checkable in the list in the wizard).

    If I double-click the warning in VS's list and let the error be automatically fixed (by adding the Id property to the derived entity), I then get errors stating that there should not be identity members on a vertically inherited class.

    What am I doing wrong here?!

    (I'm using VS2012, latest available version of OpenAccess)

    Any help greatly appreciated,
    Regards,

    Chris





  2. Yordan
    Admin
    Yordan avatar
    39 posts

    Posted 09 Jul 2013 Link to this post

    Hello Chris,

    Please find the answer in this duplicating forum thread. Should we need further communication on the issue you can use the other thread for consistency. 
     
    Regards,
    Yordan
    Telerik
    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvementsshipped with this release.

  3. DevCraft banner
Back to Top