-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registered type handler is not used for anonymous enums #2956
Comments
Hello @xrayw , Could you provide a complete test case. or example project? |
Hello, @harawata https://github.com/xrayw/mybatis-issue-2956 |
Thank you for the test, @xrayw ! I could verify the issue and merged the fix ( #2957 ). [1] https://github.com/mybatis/mybatis-3/wiki/Maven |
Fixed |
Example:
Create a custom enum TypeHandler without
MappedJdbcTypes
for enumGcType
named CustomEnumTypeHandler.now the
typeHandlerRegistry.typeHandlerMap
should be{xx, GcType={null=CustomEnumTypeHandler} , xx}
next step:
Because the
GcType.ZGC
's type is GcType$1, not GcType, so the typeHandlerMap can't find the typeHandler for GcType$1,TypeHandlerRegistry#getJdbcHandlerMap
after the getJdbcHandlerMap method, the typeHandlerMap should be
{xx, GcType={null=EnumTypeHandler} , xx}
, the original{xx, GcType={null=CustomEnumTypeHandler} , xx}
was replaced.the original pr change about getJdbcHandlerMap anonymous enum #1490
MyBatis version
3.5.3
The text was updated successfully, but these errors were encountered: