title: How can I adjust datetime length in JPA?
body: <p>basically added datetime(6) in JPA without any settings.
  but I want to datetime, not datetime(6).<br>
  so I tried under line code</p>
  
  <pre class="lang-java prettyprint-override"><code>@Temporal(TemporalType.TIMESTAMP)
  @Column(name = "reg_datetime", nullable = false, length=0)
  private Date regDateTime;
  </code></pre>
  
  <p>then came out like this ddl </p>
  
  <pre class="lang-sql prettyprint-override"><code>create table school (
         id bigint not null auto_increment,
          address varchar(255),
          mod_datetime DATETIME DEFAULT CURRENT_TIMESTAMP not null,
          name varchar(20) not null,
          reg_datetime datetime(6) not null,
          primary key (id)
      ) engine=InnoDB
  </code></pre>
  
  <p>there is the super easy way under line code<br>
  but is it the only way?</p>
  
  <pre class="lang-java prettyprint-override"><code>@CreationTimestamp
  @Column(name = "reg_datetime", nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
  private LocalDateTime regDateTime;
  </code></pre>