Skip to content

Allow to customize default TypeHandler for Enum #970

@anson0370

Description

@anson0370

I want use a custom enum type handler. It always register an new instance for every enum class. Just like the EnumTypeHandler does here.

https://github.com/mybatis/mybatis-3/blob/master/src/main/java/org/apache/ibatis/type/TypeHandlerRegistry.java#L226-L229

      if (clazz.isEnum()) {
        jdbcHandlerMap = getJdbcHandlerMapForEnumInterfaces(clazz);
        if (jdbcHandlerMap == null) {
          register(clazz, new EnumTypeHandler(clazz)); // there is no way to use a custom enum type handler here now.
          return TYPE_HANDLER_MAP.get(clazz);
        }
      }

Metadata

Metadata

Assignees

Labels

enhancementImprove a feature or add a new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions