I am wokring on a history interceptor for my app. For some reason, the "id" parameter in the onSave method of my Interceptor class is always null. It is getting populated when I use it in the onDelete(), or onFlushDirty(). Does anyone know how I can get the value of the primary key from inside the onSave method if it can not be done through the id parameter? My id is setup like so in the hibernate mapping:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.iws.model.menu.Menu" table="MENU">
<id name="menuNo" column="MENU_NO" type="long" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="menuText"
column="MENU_TEXT"
not-null="true"
type="string" />
<property name="menuUrl"
column="MENU_URL"
not-null="true"
type="string" />
<property name="menuParent"
column="MENU_PARENT"
not-null="false"
type="long" />
<property name="menuShowObject"
column="MENU_SHOWOBJECT"
not-null="true"
type="long" />
<property name="menuParentOrder"
column="MENU_PARENTORDER"
not-null="true"
type="long" />
</class>
</hibernate-mapping>
Any help is appreciated.
Thanks,
Paul