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
|
|