Interface MyBatisMapperScanRegistration
public interface MyBatisMapperScanRegistration
Registers mapper interfaces with the MyBatis
Configuration of a datasource.
Implementations are generated by the micronaut-mybatis-processor for every
MyBatisMapperScan and discovered through META-INF/services. They are applied
by MyBatisFactory after all MyBatisConfigurationCustomizer beans.
- Since:
- 7.3.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidAdds a mapper interface unless it is already known to the configuration.default voidaddMappers(org.apache.ibatis.session.Configuration configuration, String packageName) Adds all mapper interfaces of a package using MyBatis runtime scanning.voidregister(org.apache.ibatis.session.Configuration configuration) Registers the mapper interfaces.
-
Method Details
-
getDatasourceName
String getDatasourceName()- Returns:
- The name of the datasource whose configuration receives the mappers
-
register
void register(org.apache.ibatis.session.Configuration configuration) Registers the mapper interfaces.- Parameters:
configuration- The MyBatis configuration
-
addMapper
Adds a mapper interface unless it is already known to the configuration.- Parameters:
configuration- The MyBatis configurationmapperType- The mapper interface
-
addMappers
Adds all mapper interfaces of a package using MyBatis runtime scanning. This is the JVM fallback for packages in which the annotation processor could not discover any mapper interface. UnlikeConfiguration.addMappers(String), interfaces already known to the configuration (for example because they are also listed explicitly) are skipped.- Parameters:
configuration- The MyBatis configurationpackageName- The package name
-