Federico Fissore wrote: >> I have a requirement to create audit history (in an audit table for every >> actual table in the db) when data gets updated. I do not want to write >> triggers in the db as the applications is db agnostic. With torque what is >> the best way to write the audit logic – should I change the do<action> >> methods to perform the audit along with the action? > > IMHO one nice way is to edit the java classes Bean.java (which extends > BaseBean.java) and override the method "save" to do something before > saving > I do that to update "modified on date" columns >
I Know this might be a bit off-topic, but you might want to see if you can integrate some sort of AOP programming style into your logic -- we use it to alter modified dates and modified users on beans before we save to the database, to provide a basic form of auditing in some cases. Perhaps intercepting the save methods would be cleaner than altering your Bean.java. A framework that handles this really easily is the Spring framework. (www.springframework.org) Michael -- Michael Kaye Senior Software Developer MX Telecom Tel: 0845 6667778 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
