baomidou / dynamic-datasource

dynamic datasource for springboot 多数据源 动态数据源 主从分离 读写分离 分布式事务
https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611
Apache License 2.0
4.67k stars 1.19k forks source link

集成mybatils plus 时,使用Lambda查询方式会使@DS失效 #207

Closed neozo closed 4 years ago

neozo commented 4 years ago

Enviroment

JDK Version(required): 1.8

SpringBoot Version(required): 2.2.2

dynamic-datasource-spring-boot-starter Version(required):2.5.6

druid Version(optional):1.1.21

Describe

集成mybatils plus 时,使用Lambda查询方式会使@DS失效

这种方式可以正常切换DS

LambdaQueryWrapper<Customer> wrapper = Wrappers.<Customer>lambdaQuery();
customerService.count(wrapper);

使用这种方式时,DS失效,使用了默认数据源 customerService.lambdaQuery().count();

Expected Result:

Actual Result:

Steps to reproduce

huayanYu commented 4 years ago

无法复现,请详细描述。