We're updating the issue view to help you get more done. 

Oracle 12 driver breaks TemporalType.DATE behaviour

Description

As described here

http://stackoverflow.com/questions/33232260/temporaltemporaltype-date-with-oracle-12

Oracle changed its handling of Date again with the 12.x drivers. The code

1 2 3 4 5 6 OracleDataSource ods = new OracleDataSource(); ... Connection conn = ods.getConnection(); PreparedStatement ps = conn.prepareStatement("UPDATE MyEntity SET importantDate = ? WHERE myentityId = 4385"); ps.setDate(1, new java.sql.Date(new java.util.Date().getTime())); ps.execute();

sets importantDate to a date with 00:00:00 when using 11.x - drivers, but 12.x saves the current time as well. As a result, date fields in entities annotated @Temporal(TemporalType.DATE) don't cut off the time part anymore.

Oracle12cDialect should provide a workaround to restore the intended behaviour.

Environment

Oracle 12c Database ojdbc6 / ojdbc7 12.1.0.1.0 hibernate 4.2.19.Final-redhat-2 / hibernate 5.0.3.Final

Status

Assignee

Unassigned

Reporter

Thomas Scheibelreiter

Suitable for new contributors

Yes, likely

Requires Release Note

Affirmative

Components

Affects versions

5.0.3

Priority

Major