Search code examples
javahibernatehibernate-enversrevisionauditing

Meaning of revision in hibernate auditing with envers


In SVN files with the same revisions which are committed together can have clear meaning which are often mentioned at commit message for example some classes may be added to a project with the same revision number to add a certain functionality.

But in hibernate auditing I do not understand what a revision can mean? I asked this question because the API of Envers are very handy with revisions and work mainly with them.


Solution

  • The docs (http://docs.jboss.org/envers/docs/) say:

    Basically, one transaction is one revision (unless the transaction didn't modify any audited entities). As the revisions are global, having a revision number, you can query for various entities at that revision, retrieving a (partial) view of the database at that revision. You can find a revision number having a date, and the other way round, you can get the date at which a revision was commited.

    So you have the same meaning and behavior. One transaction is something like one commit to SVN, you can have multiple files commited (in Hibernate they will be entities). You can then audit the entities by revision.