nhibernate - table per type inheritance error

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
shahary
Posts: 3
Joined: Wed 27 Aug 2014 07:00

nhibernate - table per type inheritance error

Post by shahary » Wed 27 Aug 2014 07:18

Hello,

I am trying to import hbm.xml file into the Devart Nhibernate Model (via visual studio).
The file contains the following definitions:
<class name="Party"
abstract="true"
table="Parties">
<id name="Id">
<generator class="identity"/>
</id>

<joined-subclass
table="People"
name="Person">
<key column="PartyId"/>
<property name="FirstName"/>
</joined-subclass>

<joined-subclass
table="Companies"
name="Company">
<key column="PartyId"/>
<property name="CompanyName"/>
</joined-subclass>
</class>

When the process ends, i get the following error:
Abstract class 'Party' cannot participate in a Table Per Type inheritance.
What is the problem with my file? It is a valid Nhibernate definition..

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: nhibernate - table per type inheritance error

Post by MariiaI » Wed 27 Aug 2014 10:32

We will investigate this behaviour and inform you about the results as soon as possible.
As a workaround, please set Abstract property to False for the entity class Party (select Properties from its shortcut menu).

shahary
Posts: 3
Joined: Wed 27 Aug 2014 07:00

Re: nhibernate - table per type inheritance error

Post by shahary » Wed 27 Aug 2014 11:04

Hello MariiaI,

The code i posted here was just a little example, i am actually trying to import a very big project to Entity Developer and can't really change the base classes to be non abstract.

I am looking forward for the results of your investigation..

Thanks a lot

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: nhibernate - table per type inheritance error

Post by MariiaI » Thu 28 Aug 2014 05:47

We have made changes, which should fix the error with TPT inheritance. The changes will be available in the next build of Entity Developer. We will inform you when it is available for download.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: nhibernate - table per type inheritance error

Post by MariiaI » Thu 04 Sep 2014 15:20

New build of Entity Developer 5.7.436 is available for download!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=30319.

shahary
Posts: 3
Joined: Wed 27 Aug 2014 07:00

Re: nhibernate - table per type inheritance error

Post by shahary » Thu 04 Sep 2014 19:38

Thats great, thanks

Post Reply