I had asked this question 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
@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:
{"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:
- when I remove the
@Convert
annotation. - Change the column type to
timestamp
in sql schema. But the desired column type isdate
nottimestamp
.
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.