if (beanDefinitions.isEmpty()) {
logger.warn("No MyBatis mapper was found in '" + MapperScannerConfigurer.this.basePackage
+ "' package. Please check your configuration.");
} else {
for (BeanDefinitionHolder holder : beanDefinitions) {
GenericBeanDefinition definition = (GenericBeanDefinition) holder.getBeanDefinition();
if (logger.isDebugEnabled()) {
logger.debug("Creating MapperFactoryBean with name '" + holder.getBeanName() + "' and '"
+ definition.getBeanClassName() + "' mapperInterface");
}
// the mapper interface is the original class of the bean
// but, the actual class of the bean is MapperFactoryBean
definition.getPropertyValues().add("mapperInterface", definition.getBeanClassName());
definition.setBeanClass(MapperFactoryBean.class);
definition.getPropertyValues().add("addToConfig", MapperScannerConfigurer.this.addToConfig);
if (MapperScannerConfigurer.this.sqlSessionFactory != null) {
definition.getPropertyValues().add("sqlSessionFactory",
MapperScannerConfigurer.this.sqlSessionFactory);
}
if (MapperScannerConfigurer.this.sqlSessionTemplate != null) {
definition.getPropertyValues().add("sqlSessionTemplate",
MapperScannerConfigurer.this.sqlSessionTemplate);
}
}
}