0 Replies Latest reply on Oct 5, 2005 4:15 AM by J-C jc

    Problem using @PreUpdate  in a callback

    J-C jc Apprentice

      I have the following model:

      public class Widget implements Serializable,Auditable {
       public AuditInfo getAuditInfo() {
       return auditInfo;

      The AuditCallbackListener looks like:
      public class AuditCallbackListener {
       public void doPreUpdate(Auditable audit) throws Exception{
       System.out.println("doPreUpdate ...");
       AuditInfo info = audit.getAuditInfo();
       info.setLastUpdated(new Date(System.currentTimeMillis()));

      When I update a widget, I any case I see the trace write in @PreUpdate.

      When AuditInfo is declared as embedded, the last update date is persisted in the DB.

      But if AuditInfo is an entity (@OneToOne relationship instead of @embedded) the date is not persisted in DB.

      Is it a bug ? Any suggestions are welcome !