max wrote:
so does your class actually have that property ? and is it in the classpath ?
Sorry I should clarify, we use xdoclet to generate the hbm files. Now under Hibernate 3 the hbm file the history table looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
>
<class
name="com.bps.gs.sox.domain.notification.NotificationHistory"
table="NotificationsHistory"
polymorphism="explicit"
optimistic-lock="none"
>
<cache usage="nonstrict-read-write" />
<id
name="id"
column="NotificationId"
type="long"
unsaved-value="-1"
>
<generator class="assigned">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-NotificationHistory.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<property
name="deletedBy"
type="java.lang.String"
update="true"
insert="true"
column="Deletedby"
length="255"
/>
<property
name="dateDeleted"
type="timestamp"
update="true"
insert="true"
column="Datedeleted"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-NotificationHistory.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
And of course I get the exception I mentioned in my original post. When I put in the fields from the parent table into the hbm file, (the way the hbm file looked when generated under Hibernate 2 - see my original post) the NotificationsHistory table now duplicates those fields from the parent Notifications table in the database.
I'm looking for an understanding of what the hbm for the NotificationsHistory table needs to look like so that I don't need to change the table structure. (Our app is in production so changing the database would require a migration script.)
How do I avoid this and get the same behaviour I had before.
cheers,
Marc