title: What MySQL type to use for java.time.ZonedDateTime
body: <p>1) How many columns do I need in MySQL database to store <strong>java.time.ZonedDateTime</strong>?</p>
  
  <p>2) <strong>DATETIME vs TIMESTAMP</strong> MySQL types - what is better to store ZonedDateTime and LocalDateTime</p>
  
  <p>Based on this <a href="http://www.joda.org/joda-time-hibernate/userguide.html" rel="nofollow">article</a> PersistentDateTimeTZ is used to store joda DateTime in 2 columns. So I expect to have the same for  But when I try to use</p>
  
  <pre><code>@Columns(columns={@Column(name="transaction_date"),@Column(name="transaction_date_tz")})
      @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentZonedDateTime")
      private ZonedDateTime transactionDate;
  </code></pre>
  
  <p>I get exception:</p>
  
  <pre><code>Caused by: org.hibernate.MappingException: property mapping has wrong number of columns: my.package.Transaction.transactionDate type: org.jadira.usertype.dateandtime.threeten.PersistentZonedDateTime
      at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:484)
      at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
  </code></pre>
  
  <p>P.S.</p>
  
  <p>hibernate-version 4.2.7.Final</p>
  
  <p>jadira-version 4.0.0.GA </p>