File tree Expand file tree Collapse file tree 1 file changed +29
-3
lines changed
mybatis-spring-boot-autoconfigure/src/site/xdoc Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change 36
36
37
37
<ul >
38
38
<li >Build standalone applications.</li >
39
- <li >Reduce the boilerplate to almost zero.</li >
40
- <li >Less XML configuration.</li >
41
- </ul >
39
+ <li >Reduce the boilerplate to almost zero.</li >
40
+ <li >Less XML configuration.</li >
41
+ </ul >
42
42
43
43
</subsection >
44
44
@@ -331,6 +331,32 @@ ConfigurationCustomizer mybatisConfigurationCustomizer() {
331
331
332
332
</subsection >
333
333
334
+ <subsection name =" Using the SpringBootVFS" >
335
+ <p >
336
+ The MyBatis-Spring-Boot-Starter provides the <code >SpringBootVFS</code > as an implementation class of <code >VFS</code >.
337
+ The <code >VFS</code > is used for searching classes (e.g. target class of type alias, type handler class) from an application (or application server).
338
+ If you run a Spring Boot application using the executable jar, you need to use the <code >SpringBootVFS</code >.
339
+ The auto-configuration feature provided by the MyBatis-Spring-Boot-Starter used it automatically,
340
+ but it does not use automatically by a manual configuration (e.g. when uses multiple <code >DataSource</code >).
341
+ </p >
342
+
343
+ <p >
344
+ How to use the <code >SpringBootVFS</code > on manual configuration:
345
+ </p >
346
+
347
+ <source ><![CDATA[
348
+ // @Configuration class
349
+ @Bean
350
+ public SqlSessionFactory masterSqlSessionFactory() throws Exception {
351
+ SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
352
+ factoryBean.setDataSource(masterDataSource());
353
+ factoryBean.setVfs(SpringBootVFS.class); // Sets the SpringBootVFS class into SqlSessionFactoryBean
354
+ // ...
355
+ return factoryBean.getObject();
356
+ }
357
+ ]]> </source >
358
+ </subsection >
359
+
334
360
<subsection name =" Detecting MyBatis components" >
335
361
336
362
<p >The MyBatis-Spring-Boot-Starter will detects beans that implements following interface provided by MyBatis.</p >
You can’t perform that action at this time.
0 commit comments