diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java index 18fe91b33a0..d856ba9b0b2 100755 --- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java +++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java @@ -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 }