TPH Designer Problem

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Posts: 1
Joined: Sun 21 Aug 2016 18:44

TPH Designer Problem

Post by pschimmel » Sun 21 Aug 2016 19:22

I've got a problem with with Entity Developer and some inherited classes using the TPH strategy.

My inheritance structure consists of one abstract base class (MeetingItemBase) and two inherited concrete classes (MeetingItem and MeetingTodoItem). These classes should be mapped to one table called "meeting_items".

As my project relays on an existing database I created the model from the database. During the creation of the model from the database the designer only showed one class, so I created the two derived classes by hand and set the automatically created class as base class and marked it as abstract. I also renamed the classes to match the names of my desired structure.

My problem is now that sometimes the Entity Developer forgets about the mapping of the classes to the table. When I right-click on the classes and choose "Mapping Details" the base class is not mapped to a table at all.

The problem is when I query for all table entries like

from i in context.MeetingItemsBase
select i;

I get an error message like tablemeetingitembases does not exist.

When I change the table mappings in a way that the base class is also mapped to the table and all properties that the concrete classes share are mapped in the base class the query above works without error message.

The problem is that the entity developer resets my changes from time to time (although I have not recreated the model) to the original settings.

I'm using the dotConnect MySQL data provider to connect to an existing database and created the model from there, but I don't think the problem is related to the data provider.

Devart Team
Posts: 7979
Joined: Thu 14 Aug 2008 12:44

Re: TPH Designer Problem

Post by Shalex » Wed 24 Aug 2016 16:30

Please send us a small test project with the corresponding DDL/DML script and specify the exact steps we should follow for reproducing.

In case of >2MB attachment, we recommend either using some file exchange server (send us the corresponding link) or uploading a test project to our FTP server (the credentials will be provided by email request).

Post Reply