-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support for multiple data sources #178
Comments
Hi @hatunet, wasn't this already possible? I was using multiple data source. Will you this time write a documentation? |
多数据源功能实现了吗? |
我看您之前有提交实现多数据源相关功能的代码,后面又删除了。是因为实现的不是你想要的样子? 之前的是可以做到调用不同方法,使用不同的数据源吧。但@Datasource在类上并不起作用,对吧。 |
@Datasource定义在子类的方法上时; 执行CrudRepository父接口的方法时,切面获取不到子接口的@Datasource注解?! |
有bug |
如果你有思路 可以给个PR |
我重写了MultipleDataSourceAspect,不同的datasource的repository放在不同的包,在MultipleDataSourceAspect根据包路径切面来切换数据源了...这个方案可行,但不算是通用方案。 |
AOP不是问题,关键是事务 |
Support for multiple data sources
use
@DataSource
annotation to determine which datasource will be use.@DataSource
support Repository Class and Method level.If not assigned a
@DataSource
annotation will use primary datasource.The text was updated successfully, but these errors were encountered: