if (obj instanceof Auditable) {
DateTime currentTimeStamp = new DateTime();
String currentUser = auditorAwareBean.getCurrentAuditor();
Auditable auditable = (Auditable) obj;
if (auditable.getCreatedDate() == null) {
auditable.setCreatedDate(currentTimeStamp);
auditable.setCreatedBy(currentUser);
}
auditable.setLastModifiedBy(currentUser);
auditable.setLastModifiedDate(currentTimeStamp);
}
}
}