I am trying to figure out how Spring inserts the createdDate
and lastModifiedDate
automatically when auditing is configured. I have looked over the reference docs for Spring Data JPA but they only explain how to configure auditing. So how does this work behind the scenes?
I am asking this so I could insert extra auditing data like IP-Address of the user the same way.
Spring data commons has class AuditingHandler , which is responsible for populating createdDate and lasModifiedDate .
You should go-ahead check this link for class definiton and check below methods:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.