How does @CreatedBy work in Spring Data JPA?

I used the @CreatedDate entity property and I see that it inserts a date in db. I don't understand what the purpose of the @CreatedBy annotation in Spring Data JPA is.

In the reference documentation, I read:

We provide @CreatedBy , @LastModifiedBy to capture the user who created or modified the object.

But how to create and use such a user?

+6
source share
1 answer

If you’ve already turned to the help documentation, I recommend reading two more paragraphs to learn how to use AuditorAware :)

+9
source

Source: https://habr.com/ru/post/984746/


All Articles