Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarrez committed Jun 14, 2024
1 parent 542ca9a commit af0d12f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -940,11 +940,15 @@ public void initMybatisTypeHandlers(Configuration configuration) {
// Together with this check, all mappings were reviewed and the correct type was added.
if (databaseType.equals(DATABASE_TYPE_MSSQL)) {
handlerRegistry.register(Object.class, JdbcType.VARCHAR, new StringTypeHandler());
handlerRegistry.register(String.class, JdbcType.VARCHAR, new StringTypeHandler());
handlerRegistry.register(Object.class, JdbcType.NVARCHAR, new NStringTypeHandler()); // Notice the 'N' prefix here
handlerRegistry.register(String.class, JdbcType.NVARCHAR, new NStringTypeHandler()); // Notice the 'N' prefix here
} else {
// However, for other databases, we want to keep the old behavior of always using 'varchar',
// thus the same handler is used for both types.
handlerRegistry.register(String.class, JdbcType.VARCHAR, new StringTypeHandler());
handlerRegistry.register(Object.class, JdbcType.VARCHAR, new StringTypeHandler());
handlerRegistry.register(String.class, JdbcType.NVARCHAR, new StringTypeHandler()); // Notice: no 'N' prefix here
handlerRegistry.register(Object.class, JdbcType.NVARCHAR, new StringTypeHandler()); // Notice: no 'N' prefix here
}

Expand Down

0 comments on commit af0d12f

Please sign in to comment.