We are using hibernate-envers and having *_AUD table that stores historical state of entities. There is also a global REVINFO table which contains revision number, timestamp.
I need to add user as field in REVINFO table. How to add "user" field in REVINFO table?
You can definitely create your custom RevisionInfo entity. The custom revisions entity must have an integer-valued unique property (preferably the primary id) annotated with {@link RevisionNumber} and a long-valued property annotated with {@link RevisionTimestamp}.
The {@link DefaultRevisionEntity} already has those two fields, so you may extend it, but you may also write your own revision entity from scratch. So in your case the revision entity may look like following:
In addition to that you can also give your custom RevisionListener for any other special needs . See following example:
The custom RevisionListener can be provided as an argument to RevisionEntity annotation.