Java 8 LocalDate in hibernate wrongly mapped to TIMESTAMP
<p>I use Spring boot 1.4.2, which brings hibernate 5.0.11 (JPA 2.1).
I want to use the Java 8 time classes in my entities, and so included <code>hibernate-java8</code>.</p>

<p>My entity defines a LocalDate field.</p>

<pre><code>@Entity
@Table(name = "my_alarms_timeline", indexes = {...})
public class MyAlarm {
    ...
    @Column(name = "validity_date")
    @NotNull
    private LocalDate validityDate;
}
</code></pre>

<p>I expect this to be mapped to a DATE in my H2 database.</p>

<p>In my DB I declare this as <code>validity_date DATE NOT NULL,</code>.</p>

<p>When I try to run tests, I get the following error:</p>

<pre><code>[INFO] Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: 
    Schema-validation: wrong column type encountered in column [validity_date] in table [my_alarms_timeline]; 
    found [date (Types#DATE)], but expecting [timestamp (Types#TIMESTAMP)]
</code></pre>

<p>To my surprise, if I change the DB definition to <code>validity_date TIMESTAMP NOT NULL,</code>  I get the error</p>

<pre><code>Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: 
    Schema-validation: wrong column type encountered in column [validity_date] in table [my_alarms_timeline]; 
    found [timestamp (Types#TIMESTAMP)], but expecting [date (Types#DATE)]
</code></pre>

<p>This is just the reverse message of the previous one.</p>

<p>I also tried, instead of including <code>hibernate-java8</code>, to use an <code>AttributeConverter&lt;LocalDate, java.sql.Date&gt;</code> but this produces the same error result.</p>

<p><strong>What must I do, so that my LocalDate is mapped correctly to a DATE in the DB?</strong></p>

<p>I also tried with a <code>LocalDateTime</code> field mapped to a TIMESTAMP, and this works without problems...</p>