title: Autogenerate Timestamp as Id for database?
body: <p><code>@Id</code> attribute has in general the ability to auto generate database primary key ids.
  I'd like to have a timestamp is Id (I can ensure that there will be no 2 same timestamps).</p>
  
  <p>Would you set the timestamp directly to the property of the variable, or initilize it within the constructor, or pass it as parameter in the constructor?</p>
  
  <pre><code>@Entity
  public class MyDomain implements Serializable {
      @Id
      private Timestamp timestamp = new Timestamp(new Date().getTime());
  
      public MyDomain() {
          this.timestamp = new Timestamp(new Date().getTime());
      }
  
      public MyDomain(Timestamp timestamp) {
          this.timestamp = timestamp;
      }
  }
  </code></pre>
  
  <p>What would you chose, and why?</p>