@Retention(value=RUNTIME) @Target(value=TYPE) @Documented @Import(value=MapperScannerRegistrar.class) public @interface MapperScan
| 限定符和类型 | 可选元素和说明 |
|---|---|
java.lang.Class<? extends java.lang.annotation.Annotation> |
annotationClass
This property specifies the annotation that the scanner will search for.
|
java.lang.Class<?>[] |
basePackageClasses
Type-safe alternative to
basePackages() for specifying the packages
to scan for annotated components. |
java.lang.String[] |
basePackages
Base packages to scan for MyBatis interfaces.
|
java.lang.Class<? extends MapperFactoryBean> |
factoryBean
Specifies a custom MapperFactoryBean to return a mybatis proxy as spring bean.
|
java.lang.Class<?> |
markerInterface
This property specifies the parent that the scanner will search for.
|
java.lang.Class<? extends org.springframework.beans.factory.support.BeanNameGenerator> |
nameGenerator
The
BeanNameGenerator class to be used for naming detected components
within the Spring container. |
java.lang.String |
prefix |
java.lang.String[] |
properties
配置,一行一个配置
|
java.lang.String |
sqlSessionFactoryRef
Specifies which
SqlSessionFactory to use in the case that there is
more than one in the spring context. |
java.lang.String |
sqlSessionTemplateRef
Specifies which
SqlSessionTemplate to use in the case that there is
more than one in the spring context. |
java.lang.String |
templateContextRef
还可以直接配置一个 模版上下文 bean
|
java.lang.String[] |
value
Alias for the
basePackages() attribute. |
public abstract java.lang.String[] value
basePackages() attribute. Allows for more concise
annotation declarations e.g.:
@EnableMyBatisMapperScanner("org.my.pkg") instead of {@codepublic abstract java.lang.String[] basePackages
public abstract java.lang.Class<?>[] basePackageClasses
basePackages() for specifying the packages
to scan for annotated components. The package of each class specified will be scanned.
Consider creating a special no-op marker class or interface in each package that serves no purpose other than being referenced by this attribute.
public abstract java.lang.Class<? extends org.springframework.beans.factory.support.BeanNameGenerator> nameGenerator
BeanNameGenerator class to be used for naming detected components
within the Spring container.public abstract java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass
The scanner will register all interfaces in the base package that also have the specified annotation.
Note this can be combined with markerInterface.
public abstract java.lang.Class<?> markerInterface
The scanner will register all interfaces in the base package that also have the specified interface class as a parent.
Note this can be combined with annotationClass.
public abstract java.lang.String sqlSessionTemplateRef
SqlSessionTemplate to use in the case that there is
more than one in the spring context. Usually this is only needed when you
have more than one datasource.public abstract java.lang.String sqlSessionFactoryRef
SqlSessionFactory to use in the case that there is
more than one in the spring context. Usually this is only needed when you
have more than one datasource.public abstract java.lang.Class<? extends MapperFactoryBean> factoryBean
Copyright © 2018. All Rights Reserved.