Skip to content

Mybatis do not find the correct handler for a class #1065

@marnavleo

Description

@marnavleo

MyBatis version

3.4.4

Situation
One generic handler for several java classes:
@MappedTypes({ FirtsClass,.., LastClass, ... 57 classes})
public class ConstantTranslationHandler<E extends Enum & HasValue> extends BaseTypeHandler {
...
}

Just one handler declared in ibatis-config

Result

  • 57 handlers are created when the application is started
  • When the resultmap is obtained, the handler is called correctly, but the wrong handler!!!
  • I debugged and i realized that there was one handler per each class but the TypeHandlerRegistry always return the last instanced handler .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions