mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
update docs
This commit is contained in:
parent
5e94ec87b3
commit
63d0a7133e
@ -72,6 +72,9 @@ MyBatis-Flex 提供了 4 种方式来配置数据源:
|
||||
- 3、`@UseDataSource("dataSourceName")` 在 Mapper 方法上,添加注解,用于指定使用哪个数据源。
|
||||
- 4、`@Table(dataSource="dataSourceName")` 在 Entity 类上添加注解,该 Entity 的增删改查请求默认使用该数据源。
|
||||
|
||||
> 在 SpringBoot 项目上,`@UseDataSource("dataSourceName")` 也可用于在 Controller 或者 Service 上。若是 Spring 项目(非 SpringBoot),
|
||||
> 用户需要参考 `MultiDataSourceAutoConfiguration` 进行配置后才能使用。
|
||||
|
||||
|
||||
`DataSourceKey.use` 示例:
|
||||
```java 2,6
|
||||
|
||||
@ -9,7 +9,7 @@ MyBatis-Flex 使用了 APT(Annotation Processing Tool)技术,在项目编
|
||||
|
||||
## 配置文件和选项
|
||||
|
||||
要对 MyBatis-Flex 的 APT 细节选项进行配置,你需要在项目的 **根目录** 下创建名为 `mybatis-flex.config` 的文件。
|
||||
要对 MyBatis-Flex 的 APT 细节选项进行配置,你需要在项目的 **根目录** ( `pom.xml` 所在的目录)下创建名为 `mybatis-flex.config` 的文件。
|
||||
|
||||
支持的配置选项如下:
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user