-->
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: Fetching entityName in an interceptor
PostPosted: Wed Dec 27, 2006 6:20 am 
Newbie

Joined: Sun Mar 12, 2006 2:44 pm
Posts: 10
Hi,


Q: Is it possible to get entityName of a current object passed to an interceptor in a callback handler (onSave or onFlushDirty)?


I saw getEntityName() in the Interceptor interface, but I don't know how would I implemented that in my interceptor.

In my application I use interptor to save copy of created/modified objects to another table (historical data) using entityName property. I would like to check entityName to know if it is original object or already its copy.
I walked about this problem using another (temporary) session in callback with empty interceptor (SessionFactory.openSession(connection, new MyEmptyInterceptor())), but maybe it can be done in a "normal" way?

Btw, I saw in hibernate code that there is no problem with that in the Events mechanism (and probably I will use it), but I wonder how it is in the Interceptors.

Hibernate version: 3.1.2


Marcin


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.