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

Merged
merged 2 commits into from Apr 16, 2017

Conversation

Projects
None yet
3 participants
@harawata
Member

harawata commented Apr 14, 2017

PR #947 didn't work as expected. An enum type handler needs to take enum type as constructor argument.

@kazuki43zoo

This comment has been minimized.

Show comment
Hide comment
@kazuki43zoo

kazuki43zoo Apr 14, 2017

Member

@harawata It seem good !! 👍

Member

kazuki43zoo commented Apr 14, 2017

@harawata It seem good !! 👍

@kazuki43zoo

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()));

This comment has been minimized.

@kazuki43zoo

kazuki43zoo Apr 14, 2017

Member

I think that it is better to register the creating type handler in association with Enum type for performance. What do you think ?

@kazuki43zoo

kazuki43zoo Apr 14, 2017

Member

I think that it is better to register the creating type handler in association with Enum type for performance. What do you think ?

This comment has been minimized.

@kazuki43zoo

kazuki43zoo Apr 14, 2017

Member

I withdraw above comment because it work fine in current implementation.

@kazuki43zoo

kazuki43zoo Apr 14, 2017

Member

I withdraw above comment because it work fine in current implementation.

This comment has been minimized.

@harawata

harawata Apr 16, 2017

Member

OK. Let's merge this and see how it works!

@harawata

harawata Apr 16, 2017

Member

OK. Let's merge this and see how it works!

@harawata harawata merged commit 4d57247 into mybatis:master Apr 16, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@kazuki43zoo kazuki43zoo added this to the 3.4.5 milestone Apr 16, 2017

@mahengyang

This comment has been minimized.

Show comment
Hide comment
@mahengyang

mahengyang Jul 20, 2017

type.getEnumConstants() return null when type is HasValue.class

type.getEnumConstants() return null when type is HasValue.class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment