-
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
Fixes incomplete PR #947. #976
Fixes incomplete PR #947. #976
Conversation
…o a new instance of the type handler that takes the enum type as a constructor argument.
@harawata It seem good !! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added one comment.
Please check it.
HashMap<JdbcType, TypeHandler<?>> newMap = new HashMap<JdbcType, TypeHandler<?>>(); | ||
for (Entry<JdbcType, TypeHandler<?>> entry : jdbcHandlerMap.entrySet()) { | ||
// Create a type handler instance with enum type as a constructor arg | ||
newMap.put(entry.getKey(), getInstance(enumClazz, entry.getValue().getClass())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it is better to register the creating type handler in association with Enum type for performance. What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I withdraw above comment because it work fine in current implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Let's merge this and see how it works!
…erface-take2 Proper fix for mybatis#947 . When there is a type handler registered to a super interface of an enum, new instance of the type handler should be created with the enum type as a constructor argument.
PR #947 didn't work as expected. An enum type handler needs to take enum type as constructor argument.