1 Reply Latest reply on Apr 18, 2018 7:14 AM by varkon

    Problem with @Temporal(TemporalType.DATE) on WildFly 11

    varkon Newbie

      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 versionValue to persistPersisted value
      8.2.12015-05-12T10:00:00+03002015-05-12T00:00:00+0300
      11.0.02015-05-12T10:00:00+03002015-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