Skip to content

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

@lonecloud

Description

@lonecloud

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions