# LocalDate treated as timestamp in H2 on JBoss 7.2.4

**URL:** <https://discourse.hibernate.org/t/localdate-treated-as-timestamp-in-h2-on-jboss-7-2-4/3929>\
**Category:** Hibernate ORM\
**Created:** [March 23, 2020, 6:48am UTC](https://discourse.hibernate.org/t/localdate-treated-as-timestamp-in-h2-on-jboss-7-2-4/3929 "2020-03-23T06:48:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![faisal6621](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/faisal6621/32/1002_2.png) [@faisal6621](https://discourse.hibernate.org/u/faisal6621)\
**Post date:** [March 23, 2020, 6:48am UTC](https://discourse.hibernate.org/t/localdate-treated-as-timestamp-in-h2-on-jboss-7-2-4/3929/1 "2020-03-23T06:48:07Z")

</div>

I had asked this [question](https://stackoverflow.com/questions/60725695/hibernate-schema-validation-failure-for-localdate-found-date-but-expecting-ti) already on StackOverflow but did not received a satisfactory answer.

I have a column of `date` type in H2 database and the respective field in Java entity is

```java
    @NotNull
    @Convert(converter = LocalDateConverter.class)
    private LocalDate someDate;

```

When I deploy the application on JBoss 7.2.4 (EAP) the schema validation fails with error:

```java
{"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"project-name.ear#MyPersistenceUnit\"" => "javax.persistence.PersistenceException: [PersistenceUnit: MyPersistenceUnit] Unable to build Hibernate SessionFactory
    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: MyPersistenceUnit] Unable to build Hibernate SessionFactory
    Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [someDate] in table [SOME_TABLE]; found [date (Types#DATE)], but expecting [timestamp (Types#TIMESTAMP)]"}}

```

The situation in which this works well are:

1. when I remove the `@Convert` annotation.
2. Change the column type to `timestamp` in sql schema. _But the desired column type is `date` not `timestamp`._

I could not understand why the `LocalDate` is expecting to be of type `timestamp` instead of `date`?

_For information the hibernate version in JBoss 7.2.4 (EAP) is **5.3.7**._

---

<div class="post-metadata">

**Author:** ![faisal6621](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/faisal6621/32/1002_2.png) [@faisal6621](https://discourse.hibernate.org/u/faisal6621)\
**Post date:** [March 30, 2020, 4:51am UTC](https://discourse.hibernate.org/t/localdate-treated-as-timestamp-in-h2-on-jboss-7-2-4/3929/2 "2020-03-30T04:51:59Z")

</div>

Today I tested this on PostgreSQL and got the same issue. But this works well only on Oracle so far.

---

<div class="post-metadata">

**Author:** ![faisal6621](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/faisal6621/32/1002_2.png) [@faisal6621](https://discourse.hibernate.org/u/faisal6621)\
**Post date:** [April 17, 2020, 10:51am UTC](https://discourse.hibernate.org/t/localdate-treated-as-timestamp-in-h2-on-jboss-7-2-4/3929/3 "2020-04-17T10:51:39Z")

</div>

I’d accepted this [answer](https://stackoverflow.com/a/60727275/725306) on StackOverflow. But I still unable to get why the `@Convert` annotation had the issue with data type.
