2 Replies Latest reply on Jun 18, 2006 5:25 AM by Goran Ehrsson

    Audit implementation

    J-C jc Apprentice


      I try to implement an audit based on my entity. The problem is that I should save the date of each modification but also mark the data that has been changed.

      I try to use @preUdate and @prePersist annotations.

      For the moment my solution (and I'm not very happy with it) is to use
      @PostLoad to save in a transient map the list of attribute that I want to audit and to check in @PreUdate what has changed between my map and the entity. It is probably a bad solution concerning the FecthType.LAZY.

      Is it possible to get a list of Field that have been updated ?. I suppose that hibernate need that kind of information to know what has to be persisted.
      Any suggestions are welcome ...