-->
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.  [ 3 posts ] 
Author Message
 Post subject: Distinguish Save and Update in Interceptor
PostPosted: Sun Dec 05, 2004 1:46 pm 
Newbie

Joined: Thu May 13, 2004 7:47 pm
Posts: 11
Hibernate version:2.1.x

In Lifecyle interface, there are onSave and onUpdate so I can distinguish save (new object) and update (existing object). I don't see that in interceptor since there is only onSave. Do I miss anything? How do I distinguish if the object is "INSERT" or "UPDATE" into the database?

Thanks.

- Wei Chen


Top
 Profile  
 
 Post subject: More info/question
PostPosted: Mon Dec 06, 2004 2:03 am 
Newbie

Joined: Thu May 13, 2004 7:47 pm
Posts: 11
After digging into HiA Auditable interceptor example, I guess onFlushDirty is where I can handle the "UPDATE" object, where onSave only for "INSERT" object. Am I right?

Also the JavaDoc of the two method seems indicating that these two methods are called in totally different place. onFlushDirty is called during session flush. I.e. session.update(object) doesn't invoke onFlushDirty method on a session interceptor. However, session.save(object) will invoke onSave method on a session interceptor. Am I right?

Thanks for shedding some lights here.

- Wei Chen


Top
 Profile  
 
 Post subject: Help
PostPosted: Thu Dec 09, 2004 10:56 pm 
Newbie

Joined: Thu May 13, 2004 7:47 pm
Posts: 11
Is there anyone who can help me out on this?

Thanks in advance.

- Wei Chen


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

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.