Page 1 of 1

nhibernate - table per type inheritance error

Posted: Wed 27 Aug 2014 07:18
by shahary
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..

Re: nhibernate - table per type inheritance error

Posted: Wed 27 Aug 2014 10:32
by MariiaI
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).

Re: nhibernate - table per type inheritance error

Posted: Wed 27 Aug 2014 11:04
by shahary
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

Re: nhibernate - table per type inheritance error

Posted: Thu 28 Aug 2014 05:47
by MariiaI
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.

Re: nhibernate - table per type inheritance error

Posted: Thu 04 Sep 2014 15:20
by MariiaI
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.

Re: nhibernate - table per type inheritance error

Posted: Thu 04 Sep 2014 19:38
by shahary
Thats great, thanks