File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
main/java/org/mybatis/spring/mapper
test/java/org/mybatis/spring/mapper Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -262,8 +262,12 @@ private void processBeanDefinitions(Set<BeanDefinitionHolder> beanDefinitions) {
262
262
// but, the actual class of the bean is MapperFactoryBean
263
263
definition .getConstructorArgumentValues ().addGenericArgumentValue (beanClassName ); // issue #59
264
264
try {
265
+ Class <?> beanClass = Resources .classForName (beanClassName );
266
+ // Attribute for MockitoPostProcessor
267
+ // https://github.com/mybatis/spring-boot-starter/issues/475
268
+ definition .setAttribute (FACTORY_BEAN_OBJECT_TYPE , beanClass );
265
269
// for spring-native
266
- definition .getPropertyValues ().add ("mapperInterface" , Resources . classForName ( beanClassName ) );
270
+ definition .getPropertyValues ().add ("mapperInterface" , beanClass );
267
271
} catch (ClassNotFoundException ignore ) {
268
272
// ignore
269
273
}
@@ -272,10 +276,6 @@ private void processBeanDefinitions(Set<BeanDefinitionHolder> beanDefinitions) {
272
276
273
277
definition .getPropertyValues ().add ("addToConfig" , this .addToConfig );
274
278
275
- // Attribute for MockitoPostProcessor
276
- // https://github.com/mybatis/spring-boot-starter/issues/475
277
- definition .setAttribute (FACTORY_BEAN_OBJECT_TYPE , beanClassName );
278
-
279
279
boolean explicitFactoryUsed = false ;
280
280
if (StringUtils .hasText (this .sqlSessionFactoryBeanName )) {
281
281
definition .getPropertyValues ().add ("sqlSessionFactory" ,
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2010-2022 the original author or authors.
2
+ * Copyright 2010-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -399,7 +399,7 @@ void testMapperBeanAttribute() {
399
399
startContext ();
400
400
401
401
assertThat (applicationContext .getBeanDefinition ("annotatedMapper" )
402
- .getAttribute (ClassPathMapperScanner .FACTORY_BEAN_OBJECT_TYPE )).isEqualTo (AnnotatedMapper .class . getName () );
402
+ .getAttribute (ClassPathMapperScanner .FACTORY_BEAN_OBJECT_TYPE )).isEqualTo (AnnotatedMapper .class );
403
403
}
404
404
405
405
private void setupSqlSessionFactory (String name ) {
You can’t perform that action at this time.
0 commit comments