File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
main/java/org/mybatis/spring/mapper
test/java/org/mybatis/spring/mapper Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,8 @@ public class MapperScannerConfigurer implements BeanDefinitionRegistryPostProces
117
117
118
118
private String beanName ;
119
119
120
+ private boolean processPropertyHolders ;
121
+
120
122
/**
121
123
* This property lets you set the base package for your mapper interface files.
122
124
* <p>
@@ -230,6 +232,16 @@ public void setSqlSessionFactoryBeanName(String sqlSessionFactoryName) {
230
232
this .sqlSessionFactoryBeanName = sqlSessionFactoryName ;
231
233
}
232
234
235
+ /**
236
+ *
237
+ * @since 1.1.0
238
+ *
239
+ * @param processPropertyHolders
240
+ */
241
+ public void setProcessPropertyHolders (boolean processPropertyHolders ) {
242
+ this .processPropertyHolders = processPropertyHolders ;
243
+ }
244
+
233
245
/**
234
246
* {@inheritDoc}
235
247
*/
@@ -261,7 +273,9 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
261
273
* {@inheritDoc}
262
274
*/
263
275
public void postProcessBeanDefinitionRegistry (BeanDefinitionRegistry beanDefinitionRegistry ) throws BeansException {
264
- processPropertyPlaceHolders ();
276
+ if (this .processPropertyHolders ) {
277
+ processPropertyPlaceHolders ();
278
+ }
265
279
266
280
Scanner scanner = new Scanner (beanDefinitionRegistry );
267
281
scanner .setResourceLoader (this .applicationContext );
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ public void testScanWithPropertyPlaceholders() {
207
207
// use a property placeholder for basePackage
208
208
definition .getPropertyValues ().removePropertyValue ("basePackage" );
209
209
definition .getPropertyValues ().add ("basePackage" , "${basePackageProperty}" );
210
+ definition .getPropertyValues ().add ("processPropertyHolders" , true );
210
211
211
212
// also use a property placeholder for an SqlSessionFactory property
212
213
// to make sure the configLocation was setup correctly and MapperScanner did not change
You can’t perform that action at this time.
0 commit comments