1 Reply Latest reply on Apr 1, 2012 12:28 AM by Adam Warski

    How do you copy a revision of an entity back to the entity itself

    Paul Taylor Newbie

      So I load a song file containing metadata into my application, at this point a representation of the file is stored in the database as an Hibernate entity Song.

      My application make various changes to the metadata, and these are audited by Envers

      The changes are saved back to the file.


      At a later stage user decides they dont like the changes

      They start the application

      They select the file they want to revert

      I use AuditReader to get the earliest revison of the song entity

      I then update their file with revision

      Save changes


      So far so good, but the trouble is the Song entity still contains the changes made before reverting to the earlier revision, how can I update my song so it contains the same information as the revision.