public class MapperScannerConfigurer
extends java.lang.Object
implements org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware
| 构造器和说明 |
|---|
MapperScannerConfigurer() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
org.springframework.beans.factory.support.BeanNameGenerator |
getNameGenerator()
Gets beanNameGenerator to be used while running the scanner.
|
void |
postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) |
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) |
void |
setAddToConfig(boolean addToConfig)
Same as
MapperFactoryBean#setAddToConfig(boolean). |
void |
setAnnotationClass(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
This property specifies the annotation that the scanner will search for.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBasePackage(java.lang.String basePackage)
This property lets you set the base package for your mapper interface files.
|
void |
setBeanName(java.lang.String name) |
void |
setMarkerInterface(java.lang.Class<?> superClass)
This property specifies the parent that the scanner will search for.
|
void |
setNameGenerator(org.springframework.beans.factory.support.BeanNameGenerator nameGenerator)
Sets beanNameGenerator to be used while running the scanner.
|
void |
setProcessPropertyPlaceHolders(boolean processPropertyPlaceHolders) |
void |
setProperties(java.lang.String prefix,
java.util.Properties properties)
属性注入
|
void |
setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)
已过时。
Use
setSqlSessionFactoryBeanName(String) instead. |
void |
setSqlSessionFactoryBeanName(java.lang.String sqlSessionFactoryName)
Specifies which
SqlSessionFactory to use in the case that there is
more than one in the spring context. |
void |
setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
已过时。
Use
setSqlSessionTemplateBeanName(String) instead |
void |
setSqlSessionTemplateBeanName(java.lang.String sqlSessionTemplateName)
Specifies which
SqlSessionTemplate to use in the case that there is
more than one in the spring context. |
public void afterPropertiesSet()
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanpublic void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
postProcessBeanFactory 在接口中 org.springframework.beans.factory.config.BeanFactoryPostProcessorpublic void postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
postProcessBeanDefinitionRegistry 在接口中 org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessorpublic org.springframework.beans.factory.support.BeanNameGenerator getNameGenerator()
public void setNameGenerator(org.springframework.beans.factory.support.BeanNameGenerator nameGenerator)
nameGenerator - the beanNameGenerator to setpublic void setAddToConfig(boolean addToConfig)
MapperFactoryBean#setAddToConfig(boolean).addToConfig - MapperFactoryBean.setAddToConfig(boolean)public void setAnnotationClass(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.
annotationClass - annotation classpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext 在接口中 org.springframework.context.ApplicationContextAwarepublic void setBasePackage(java.lang.String basePackage)
You can set more than one package by using a semicolon or comma as a separator.
Mappers will be searched for recursively starting in the specified package(s).
basePackage - base package namepublic void setBeanName(java.lang.String name)
setBeanName 在接口中 org.springframework.beans.factory.BeanNameAwarepublic void setMarkerInterface(java.lang.Class<?> superClass)
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.
superClass - parent classpublic void setProcessPropertyPlaceHolders(boolean processPropertyPlaceHolders)
processPropertyPlaceHolders - @Deprecated public void setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)
setSqlSessionFactoryBeanName(String) instead.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.
sqlSessionFactory - public void setSqlSessionFactoryBeanName(java.lang.String sqlSessionFactoryName)
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.
Note bean names are used, not bean references. This is because the scanner loads early during the start process and it is too early to build mybatis object instances.
sqlSessionFactoryName - Bean name of the SqlSessionFactory@Deprecated public void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
setSqlSessionTemplateBeanName(String) insteadSqlSessionTemplate 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.
sqlSessionTemplate - public void setSqlSessionTemplateBeanName(java.lang.String sqlSessionTemplateName)
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.
Note bean names are used, not bean references. This is because the scanner loads early during the start process and it is too early to build mybatis object instances.
sqlSessionTemplateName - Bean name of the SqlSessionTemplatepublic void setProperties(java.lang.String prefix,
java.util.Properties properties)
properties - Copyright © 2019. All Rights Reserved.