-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Interceptor OnSave Null ID Param
PostPosted: Sun Oct 31, 2004 6:40 pm 
Beginner
Beginner

Joined: Fri Oct 22, 2004 4:47 pm
Posts: 22
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.