-->
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: AuditLog extension
PostPosted: Wed Nov 24, 2004 12:17 pm 
Regular
Regular

Joined: Tue Oct 07, 2003 1:13 pm
Posts: 70
Location: Paris, France
One of my customers would need to log every value change for auditable entities.

Table A (field1, field2)
The event "The value of field1 has changed" would trigger the insert of an auditlog record with the following attributes :
- Entity
- Field
- OldValue
- NewValue

So by starting from the AuditLogInterceptor, I could say it's possible because we have for example in the onFlushDirty the old and new values. But knowing Hibernate already does the job when generating an update query on only the fileds whose value has changed, I can assume the mechanism is already there. Can I take advantage easily of the Hibernate core functions to retrieve the field whose the value has changed ? What would be the best practice ?
Thank you for your help.

Richard.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2004 6:38 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
There is a full audit log interceptor in the Wiki community area. Remember that your first choice should be a database trigger.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.