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
117117
118118 private String beanName ;
119119
120+ private boolean processPropertyHolders ;
121+
120122 /**
121123 * This property lets you set the base package for your mapper interface files.
122124 * <p>
@@ -230,6 +232,16 @@ public void setSqlSessionFactoryBeanName(String sqlSessionFactoryName) {
230232 this .sqlSessionFactoryBeanName = sqlSessionFactoryName ;
231233 }
232234
235+ /**
236+ *
237+ * @since 1.1.0
238+ *
239+ * @param processPropertyHolders
240+ */
241+ public void setProcessPropertyHolders (boolean processPropertyHolders ) {
242+ this .processPropertyHolders = processPropertyHolders ;
243+ }
244+
233245 /**
234246 * {@inheritDoc}
235247 */
@@ -261,7 +273,9 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
261273 * {@inheritDoc}
262274 */
263275 public void postProcessBeanDefinitionRegistry (BeanDefinitionRegistry beanDefinitionRegistry ) throws BeansException {
264- processPropertyPlaceHolders ();
276+ if (this .processPropertyHolders ) {
277+ processPropertyPlaceHolders ();
278+ }
265279
266280 Scanner scanner = new Scanner (beanDefinitionRegistry );
267281 scanner .setResourceLoader (this .applicationContext );
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ public void testScanWithPropertyPlaceholders() {
207207 // use a property placeholder for basePackage
208208 definition .getPropertyValues ().removePropertyValue ("basePackage" );
209209 definition .getPropertyValues ().add ("basePackage" , "${basePackageProperty}" );
210+ definition .getPropertyValues ().add ("processPropertyHolders" , true );
210211
211212 // also use a property placeholder for an SqlSessionFactory property
212213 // 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