-
1. Re: Mimic Envers with JDBC?
adamw Jul 14, 2009 7:30 AM (in response to jbisotti)Hello,
how the revision number is generated depends on your database and how you define your revision entity. In mysql it's an auto_increment field by default, but you can use sequences, table generators etc, if you define the @GeneratedValue properly in the revision entity.
There's no any additional caching that Envers does. It uses Hibernate in the background so any caching can be configured there.
I guess you can safely and easily insert the data into the audit tables manually :).
Adam -
2. Re: Mimic Envers with JDBC?
jbisotti Jul 14, 2009 5:04 PM (in response to jbisotti)Adam,
I'm using Firebird as my database.
I'm not currently defining my revision entity; just using the default -- though it sounds like I'll need to???
The part I'm currently confused about is the insertion into the REVINFO table. If I do not create my own revision entity, what class do I need to instantiate/populate? Or, do I have to specify my own revision entity?
Where does this code live in the Envers packages? The code that does the default way.
Thanks for all the help!
Jamie -
3. Re: Mimic Envers with JDBC?
adamw Jul 15, 2009 2:49 AM (in response to jbisotti)Hello,
in many cases using the default will work. I don't know what's the default id generation in firebird, so hard to say :). The default revision entity is in the "DefaultRevisionEntity" class :).
Normally, you just need to insert a new row into the REVINFO table to get its id, which is the revision number. So should be doable easily via JDBC.
Adam