-->
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.  [ 2 posts ] 
Author Message
 Post subject: Interceptor onFlushDirty- properties & values [] out of
PostPosted: Fri Feb 16, 2007 2:45 am 
Newbie

Joined: Tue Mar 07, 2006 5:51 am
Posts: 11
Location: India
Hello:

I am using Hibernate Interceptor for audit logging purpose. In onFlushDirty() I am comparing oldValues[] and newValues[] to detect any change in the values. Then I noticed that the index of properties[] and the values [] (oldvaues and newValues) are not in sync. Let me give an example. I have an entity called Employee with fields name, employeeNumber and age. Assume that an update happens on Employee and onFlushDirty is called. Then my properties array is like below.

properties[0] - name
properties[1]- employeeNumber
properties[2] - age.

So I expected the oldvaues[] and newvales[] will have the following values.

oldvalues[0] - oldvalue of name
oldvalues[1] - oldvalue of employeeNumber
oldvalues[2] - oldvalue of age

newvalues[0] - newvalueof name
newvalues[1] - newvalueof employeeNumber
newvalues[2] - newvalue of age

But the indexes of properties[] and the values[] are not matching. The [0] position of newvalues and oldvalues have employeeNumber and [1] position have name and [2] position have age. Is this a bug ? I am using Hibernate-3.2.0.CR4 with Hibernate-entitymanager-3.2.0.CR1 with Jboss Seam and I am using Session Factory Scoped Interceptor.

thanks and regards,

-- Kannan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 16, 2007 3:03 am 
Newbie

Joined: Tue Mar 07, 2006 5:51 am
Posts: 11
Location: India
Hello:

Sorry... This was a mistake from my part of not correclty analyzing the values. What all I have said in the earlier post is not correct and the inteceptor is working properly. Again, sorry if have wasted some one's time..

thanks and regards,

-- Kannan.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.