In our DB we have multiple entities with Date fields. Oracle sees every date as the same, with a date and a time part. JPA entities however distinguish via the annotaton @Tempor
We have conntacted the Oracle Support and they replied as follows (unfortunately I'm not able to provide link to the answer because an Oracle Support Account is needed):
The new behaviour works as intended:
In JDBC 12.1.0.1, getDate and setDate do not truncate the time component of the date. This behavior is different to JDBC 11.2.0.X, where the time component is truncated. As per bug 14389749, 17228297 this change is deliberate and the 12c driver's behavior is correct.
The workarounds provided work for me:
Workaround #1: Modify application to not insert the time component (e.g. with a static UtilMethod)
public static Date truncateTime(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}
Workaround #2: Download and apply patch 19297927 from MOS: (My Oracle Support)
After patching replace ojdb7.jar in %Oracle_Home%\oracle_common\modules\oracle.jdbc_12.1.0
and add -Doracle.jdbc.DateZeroTime=true
to your JVM Arguments