title: How does @CreatedBy work in Spring Data JPA?
body: <p>I used <code>@CreatedDate</code> on entity property and I see that it inserts date into db. I don't understand what is the purpose of <code>@CreatedBy</code> annotation in Spring Data JPA.</p>
  
  <p>In the <a href="http://docs.spring.io/spring-data/jpa/docs/current/reference/html/index.html#auditing" rel="noreferrer">reference documentation</a> I read :</p>
  
  <blockquote>
    <p>We provide <code>@CreatedBy</code>, <code>@LastModifiedBy</code> to capture the user who created or modified the entity</p>
  </blockquote>
  
  <p>But how to create and use such user?</p>