I've got basic Envers working, and I understand how to get something like the name of the calling User into the Revision Entity, since that's effective static data. But how do I add a comment created dynamically by the user for a given revision?
I suppose I can find some way by subclassing some of the listeners and/or classes used by the listeners (or just implementing their interfaces), but if anyone out there has done this already I'd really appreciate an example.
TIA.
You write you know how to set some name of the user committing the transaction. I guess therefore you know about the
IRevisionListenerinterface - there you can modify you revision entity before it is saved.Depending on what host/client/process you run your application on, you need to set the "comment" in some suitable scope. Assuming you're using web app, you can eg set the comment on some
HttpContextitem and get this value in yourIRevisionListener.