Hi all. I'm starting a new project, and I'm running off the trunk.
I'm trying to use a mapping like the following...
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="NHibernateFun.Domain" assembly="NHibernateFun">
<class name="Entry" table="Entry">
<id name="Id" unsaved-value="0" column="EntryId">
<generator class="identity"/>
</id>
<joined-subclass name="FilledEntry" table="FilledEntry">
<key column="FilledEntryId"/>
<property name="Title" column="Title" not-null="true" />
<property name="Text" column="Text" not-null="true" />
</joined-subclass>
<joined-subclass name="EmptyEntry" table="EmptyEntry">
<key column="EmptyEntryId" />
</joined-subclass>
</class>
</hibernate-mapping>
As you can see, I have an abstract class Entry (which has no properties of its own to persist) that has two subclasses, FilledEntry and EmptyEntry. When trying to save either type of entry, I get the following error message..
Code:
could not insert: [NHibernateFun.Domain.FilledEntry][SQL: INSERT INTO Entry values ( )]
Can someone please explain to me if it's possible to alleviate this without switching to another inheritance method?
Thanks in advance.