Hi Sepp, Thank you very much for your enquiry. Currently, jOOQ doesn't support any audit functionality or one/two dimensional historisation functionality yet. Both features are on the roadmap, though:
- https://github.com/jOOQ/jOOQ/issues/1592 - https://github.com/jOOQ/jOOQ/issues/2605 Already now, you can implement a fair share of auditing directly using the RecordListener SPI, which is documented here: http://www.jooq.org/doc/latest/manual/sql-execution/crud-with-updatablerecords/crud-record-listener With this, you can intercept store calls on record. Do note, however, that all other means of storing data in the database will bypass this mechanism. You could also intercept those calls by implementing the VisitListener SPI and listening to all sorts of DML events, but that's a lot of work: http://www.jooq.org/doc/latest/manual/sql-building/queryparts/custom-sql-transformation And still, you can bypass this mechanism, e.g. by using JDBC or plain SQL directly, or via stored procedures or other ways to insert/update your data. The most robust way forward is to use database triggers for both your bullet points. Hope this helps, Lukas 2016-05-27 16:40 GMT+02:00 <[email protected]>: > Good afternoon, > > there are two features I need to implement in the software which I'm > currently developing: > > > 1. creation date, last change date, creator-user, last modified user > as columns in each table for basic tracking of that information > 2. complete change history of each table-row (in each table) > > > I'm coming from C# world, where I worked a few years with a modified > Subsonic ORM Layer. Now I have to develop this new software in Java, and > due to some recent projects where I already used jOOQ I'm also using jOOQ > right now. > > The first feature could be done on every saving operation, just upfront > setting the values. However, 2 fields are current date, and the other two > the current user. It would be cool e.g. to just use: > > dbRecord.store(userId) > > and that the "magic" is out of sight of the developer. > > The second feature is a whole different story. Currently I'm thinking of > creating triggers that will do the work in the DBMS (postgreSQL). But maybe > there are other solutions too? > > Sepp > > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
