0 Replies Latest reply on Jun 3, 2008 12:17 PM by wark2007

    Advanced trigger mechanism for Entities

      I am looking for a "trigger" implementation (similar to database trigger) for entity beans. I had a look on the EventListener and they are quite good in many cases but they have one huge disadvantage - they don't give me access to the old object, since only the current object is passed to the @PreUpdate/@PostUpdate methods.


      Is there any way to get also the old value in JPA or in the JBoss implementation, something like:

      @PreUpdate
      void preUpdate(EntityClass new, EntityClass old) {
       if (new.foo != old.foo) {
      
       }
      }