springboot动态切换数据源,注解在dao层接口上无效,但在方法上有效。
这样就是有效的
注在类上就无效
这是切面逻辑,注解在类上的时候targetDataSource和methodDataSource都是null,注解在方法上的时候,methodDataSource就能取到注解,这是为什么呢。搜了一天没搜到答案。
springboot动态切换数据源,注解在dao层接口上无效,但在方法上有效。
这样就是有效的
注在类上就无效
这是切面逻辑,注解在类上的时候targetDataSource和methodDataSource都是null,注解在方法上的时候,methodDataSource就能取到注解,这是为什么呢。搜了一天没搜到答案。