Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DS注解在Myabtis 接口优先级问题 #407

Closed
lonecloud opened this issue Nov 25, 2021 · 1 comment
Closed

DS注解在Myabtis 接口优先级问题 #407

lonecloud opened this issue Nov 25, 2021 · 1 comment

Comments

@lonecloud
Copy link
Contributor

Please fill it out carefully, or it will be closed.
请认真填写,不然会直接关闭。

Enviroment

JDK Version(required): 8

SpringBoot Version(required): 2.4.3

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

druid Version(optional):na

Describe what happened

Expected Result:

DS注解优先级问题:
查看注释查找注解的顺序

  1. 当前方法
  2. 桥接方法
  3. 当前类开始一直找到Object
  4. 支持mybatis-plus, mybatis-spring

但是当在方法和类上都加上@DS注解后,默认会获取类上注解,方法上注解会失效

@DS("pg")
public interface Mapper{
     //这个方法会查pg
     @DS("mysql") 
     public List<User> select(String id);

     public List<User> selectAnother(String id)
}

Actual Result:

If there is an exception,or aop invalid,please attach the exception trace:

Just paste your stack trace here!

Steps to reproduce

  • Step 1

  • Step 2

  • Step 3

lonecloud added a commit to lonecloud/dynamic-datasource-spring-boot-starter that referenced this issue Nov 25, 2021
@lonecloud lonecloud mentioned this issue Nov 25, 2021
6 tasks
huayanYu pushed a commit that referenced this issue Nov 25, 2021
@huayanYu
Copy link
Member

merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants