Implement LastModified event listener on prePersist and preUpdate events