Skip to content

Commit

Permalink
[hibernate#1550] Convert Timestamp to LocalDateTime for Db2
Browse files Browse the repository at this point in the history
Instead of the default OffsetDateTime
  • Loading branch information
DavideD committed Apr 4, 2023
1 parent 3d53848 commit 312a926
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.hibernate.boot.model.TypeContributions;
import org.hibernate.boot.model.TypeContributor;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.PostgreSQLDialect;
Expand Down Expand Up @@ -76,7 +77,7 @@ private void registerReactiveChanges(TypeContributions typeContributions, Servic
JavaTypeRegistry javaTypeRegistry = typeConfiguration.getJavaTypeRegistry();
javaTypeRegistry.addDescriptor( JsonObjectJavaType.INSTANCE );

if ( dialect instanceof MySQLDialect ) {
if ( dialect instanceof MySQLDialect || dialect instanceof DB2Dialect ) {
JdbcTypeRegistry jdbcTypeRegistry = typeConfiguration.getJdbcTypeRegistry();
jdbcTypeRegistry.addDescriptor( TimestampAsLocalDateTimeJdbcType.INSTANCE );
jdbcTypeRegistry.addDescriptor( TimestampUtcAsLocalDateTimeJdbcType.INSTANCE );
Expand Down

0 comments on commit 312a926

Please sign in to comment.