Hi, I'm implementing a "table per subclass" mapping, that is, i have classes that all inherit from a common parent class, that has only 2 properties ('id' and 'date'). My mapping file is:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" assembly="Assembly1">
<class name="it.commons.BaseObject" table="dummy" >
<id name="id" column="id" type="Int32">
<generator class="sequence">
<param name="sequence">seq1</param>
</generator>
</id>
<property name="date" column="date" type="DateTime"/>
</class>
<joined-subclass name="it.commons.User" table="users" extends="it.commons.BaseObject">
<key column="id"/>
<property name="nick" column="nickname" type="String" />
<property name="name" column="name" type="String" />
<property name="password" column="password" type="String" />
</joined-subclass>
</hibernate-mapping>
I want nhibernate to store all the data of an object of type "User" in the table named "users" (I'm using postgres8.1 and table "users" inherits from table "dummy"). With this mapping, nhibernate puts a row in table "dummy", and a row in table "users". What's the problem with my mapping file?
Thanks in advance!
Marco