mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
1、对动态数据源@UseDataSource的value值进行动态解析区分Spring模式下和非Spring模式下
This commit is contained in:
parent
475b0ecb3a
commit
6e2ae43ea9
@ -28,9 +28,13 @@ public class ParamIndexDataSourceProcessor implements DataSourceProcessor {
|
|||||||
if (arguments.length == 0) return null;
|
if (arguments.length == 0) return null;
|
||||||
|
|
||||||
Integer index = null;
|
Integer index = null;
|
||||||
if (INDEX_FIRST.equals(dataSourceKey)) index = 0;
|
if (INDEX_FIRST.equals(dataSourceKey)) {
|
||||||
if (INDEX_LAST.equals(dataSourceKey)) index = arguments.length - 1;
|
index = 0;
|
||||||
if (dataSourceKey.startsWith(PARAM_INDEX)) index = parseIndex(dataSourceKey);
|
} else if (INDEX_LAST.equals(dataSourceKey)) {
|
||||||
|
index = arguments.length - 1;
|
||||||
|
} else if (dataSourceKey.startsWith(PARAM_INDEX)) {
|
||||||
|
index = parseIndex(dataSourceKey);
|
||||||
|
}
|
||||||
|
|
||||||
// 没有符合约定的格式输入,则会返回 null
|
// 没有符合约定的格式输入,则会返回 null
|
||||||
if (null == index) return null;
|
if (null == index) return null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user