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

Vertical Inheritance and Extraneous Id Column

1 Answer 39 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 07 Jul 2013, 10:47 PM
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





1 Answer, 1 is accepted

Sort by
0
Yordan
Telerik team
answered on 09 Jul 2013, 04:05 PM
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.

Tags
Data Access Free Edition
Asked by
Chris
Top achievements
Rank 1
Answers by
Yordan
Telerik team
Share this question
or