title: How to autogenerate created or modified timestamp field?
body: <p>My entity class:</p>
  
  <pre><code>@Entity
  @Table(name = "user")
  public class User implements Serializable {
      private static final long serialVersionUID = 1L;
  
      @Id
      @SequenceGenerator(name = "USER_ID_GENERATOR", sequenceName = "USER_SEQ")
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "USER_ID_GENERATOR")
      @Column(name = "user_id")
      private long userId;
  
  
      @Temporal(TemporalType.DATE)
      private Date created;
  
      @Temporal(TemporalType.DATE)
      private Date modified;
  
      //setters and getters...
  }
  </code></pre>
  
  <p>I would like to CREATED and MODIFIED fields complement each other automatically when you create or modify the object. CREATED and MODIFIED fields should be of type TIMESTAMP.</p>
  
  <p>How do I achieve that?</p>