1 Reply Latest reply on Dec 31, 2008 8:09 AM by adamw

    envers and "tags" (ala cvs)

    uberto

      Hi, I've been at Antwerpen, and I saw your presentation.

      For a new project we need some basic cms capabilities, after evaluating jack rabbit we choose to use plain hibernate and manage the versions.
      Your fw is very welcome indeed, I'm doing some tests now.

      One requirement is that we need to implement a "publishing" feature, that is exporting all the content via an xml file to another app.
      Also we need to be able to "rollback" to a given published version.

      So we need to keep trace for every entity, of which revisions are published and when. Another nice feature is cleaning up all the revision data between publishing.

      I have some idea about how to implement this, but if there is some info available I'll gladly delve into them.

      TIA

      good work!

      Uberto

        • 1. Re: envers and
          adamw

          Hello!

          hop you liked the presentation and devoxx :)

          For manipulating the revisions of an entity, you must just remember that the id of an audited entity consists of the original id and the revision number - which is normally an increasing sequence. (The revision number in fact is a relation to the corresponding revision entity).

          So, for tagging, or "keeping track of when things were published", I guess an entity which would remember the (original) id and the revision number of the entities tagged would suffice.

          For removing old history, an ordinary bulk delete of all entities with revision number smaller than the currently exported one should work.

          Let me know if you run into any trouble.

          --
          Adam