Skip to content

All interfaces are registered as mybatis mappers even if they are not mappers #46

Closed
@emacarron

Description

@emacarron

Right now, the mybatis boot starter module takes all the interfaces it founds in a project and registers them as mappers. We should be able to identify if an interface is a mapper or not.

The problem is that mappers are not annotated (the @Mapper annotation does not exist). We did this because we would like to build applications with no mybatis imports at all. So they way you select your mappers when using classic configuraiton like MapperScannerConfigurer or @MapperScan is by:

  • specifiying a base package
  • specifiying a marker interface
  • specifiying a marker annotation

So, my proposal is to use this convention: mappers are supposed to be interfaces held in a */mapper or */mappers package.

For any other configuration, use the @MapperScan annotation that lets you configure everything.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions