8 Replies Latest reply on Dec 13, 2010 9:08 AM by anonimo

    Saving only modified entities

    anonimo Newbie



      I am experiencing a behavour in Hibernate that seems to be not very convenient for me.


      Say I have an Employee entity, which is annotated with @Audited. The Employee entity holds a one-to-one relationship with a Desk entity. The thing is, whenever I persist this relationship, without modifying any of the attributes of Employee and Desk, Envers creates new revisions of those entities.


      Is there a way of telling Envers not to create new revisions of an audited entity if none of the attributes have been modified? This is causing lots of duplicated records in my database as you can imagine.