Annotation Interface MyBatisMapperScan
Requests compile-time discovery of MyBatis mapper interfaces.
The micronaut-mybatis-processor generates a MyBatisMapperScanRegistration
for every annotated type. The registration adds the mapper interfaces found in value()
and listed in mappers() to the MyBatis Configuration of the datasource()
without runtime classpath scanning, which makes the registration work in GraalVM native images.
The annotation can be placed on any type, it does not have to be a bean. Only mapper interfaces
compiled together with the annotated type are discovered by package; mapper interfaces from other
modules must be listed in mappers().
- Since:
- 7.3.0
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String[] value- Returns:
- Packages containing MyBatis mapper interfaces. Sub-packages and nested interfaces are included.
- Default:
{}
-
datasource
String datasource- Returns:
- The datasource name to which the discovered mappers are registered
- Default:
"default"
-
mappers
-
nativeImageMetadata
boolean nativeImageMetadataWhether to generate the GraalVM native image metadata (dynamic proxy entries for the mapper interfaces and reflection entries for their result and parameter types), using the same mechanism as@ReflectiveAccess. The metadata is ignored on the JVM, so it only needs to be disabled when a project wants to manage the native image configuration itself.- Returns:
- Whether to generate GraalVM native image metadata
- Default:
true
-