Hello,
I have recently upgraded from WildFly 8.2.1 to WildFly 11, and also upgraded its embedded hibernate module to version 5.1.12. I am experiencing a peculiar behaviour, in my entities. All columns of type java.util.Date annotated with @Temporal(TemporalType.DATE) now also store the time information in the database, as well. This behaviour did not take place in WildFly 8.2.1, and creates a problem for us now. I have been using the same oracle 12c database for both cases.
For example, Let say we have the date 2015-05-12T10:00:00+0300. When attempting to persist that date in a column marked with @Temporal(TemporalType.DATE) I get the following behaviour:
| WildFly version | Value to persist | Persisted value |
|---|
| 8.2.1 | 2015-05-12T10:00:00+0300 | 2015-05-12T00:00:00+0300 |
| 11.0.0 | 2015-05-12T10:00:00+0300 | 2015-05-12T10:00:00+0300 |
An example of a column annotation is the following:
@Temporal(TemporalType.DATE)
@Column(name = "REG_DATE", nullable = false)
public Date getRegistrationDate() {
return this.registrationDate;
}
Is there something I am doing wrong or should be doing differently? Furthermore, should I ask this question in the Hibernate forum instead?
Any information would be greatly appreciated.
Kind regards,
Dimitris