mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
fixed register typeHandler
This commit is contained in:
parent
45d15c96df
commit
8f359c9399
@ -199,17 +199,13 @@ public class TableInfos {
|
|||||||
columnInfo.setPropertyType(field.getType());
|
columnInfo.setPropertyType(field.getType());
|
||||||
|
|
||||||
if (column != null && column.typeHandler() != UnknownTypeHandler.class) {
|
if (column != null && column.typeHandler() != UnknownTypeHandler.class) {
|
||||||
Class<? extends TypeHandler> typeHandlerClass = column.typeHandler();
|
Class<?> typeHandlerClass = column.typeHandler();
|
||||||
Configuration configuration = FlexGlobalConfig.getDefaultConfig().getConfiguration();
|
Configuration configuration = FlexGlobalConfig.getDefaultConfig().getConfiguration();
|
||||||
TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
|
TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
|
||||||
if (!typeHandlerRegistry.hasTypeHandler(typeHandlerClass)) {
|
TypeHandler<?> typeHandler = typeHandlerRegistry.getInstance(columnInfo.getPropertyType(), typeHandlerClass);
|
||||||
typeHandlerRegistry.register(typeHandlerClass);
|
|
||||||
}
|
|
||||||
TypeHandler<? extends TypeHandler> typeHandler = typeHandlerRegistry.getTypeHandler(typeHandlerClass);
|
|
||||||
columnInfo.setTypeHandler(typeHandler);
|
columnInfo.setTypeHandler(typeHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (column != null && column.jdbcType() != JdbcType.UNDEFINED) {
|
if (column != null && column.jdbcType() != JdbcType.UNDEFINED) {
|
||||||
columnInfo.setJdbcType(column.jdbcType());
|
columnInfo.setJdbcType(column.jdbcType());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user