When spring boot is integrated with mybatis, the custom typehandler (converter) is not called
First, the table structure
Entity
Enumeration type
Custom handler
mybatis.type-handlers-package has been configured
Here comes a great assist
PHP中文网2017-06-14 10:56:51
Mybatis will use EnumTypeHandler to handle Enum type by default, see the following code:
if (handler == null && type != null && type instanceof Class &&
Enum.class.isAssignableFrom((Class<?>) type)) {
handler = new EnumTypeHandler((Class<?>) type);
}
If you want to use your own typeHandler, you need to register your own typeHandler first, and then set the typeHandler when setting parameters and getting results.