コード例 #1
0
 @PreUpdate
 public void setAuditDataOnUpdate(Object object) {
   if (object instanceof Auditable) {
     Auditable auditable = (Auditable) object;
     auditable.setLastUpdateDate(new Date());
   }
 }
コード例 #2
0
 @PrePersist
 public void setAuditDataOnPersist(Object object) {
   if (object instanceof Auditable) {
     Auditable auditable = (Auditable) object;
     auditable.setCreationDate(new Date());
   }
 }