Skip to content
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

Open
easybest opened this issue Dec 14, 2018 · 8 comments
Open

Support for multiple data sources #178

easybest opened this issue Dec 14, 2018 · 8 comments
Assignees
Milestone

Comments

@easybest
Copy link
Owner

easybest commented Dec 14, 2018

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.

@easybest easybest self-assigned this Dec 14, 2018
@easybest easybest added this to the 2.0.0 milestone Dec 14, 2018
@kopax
Copy link

kopax commented Dec 14, 2018

Hi @hatunet, wasn't this already possible? I was using multiple data source. Will you this time write a documentation?

@shook2012
Copy link

多数据源功能实现了吗?

@shook2012
Copy link

我看您之前有提交实现多数据源相关功能的代码,后面又删除了。是因为实现的不是你想要的样子? 之前的是可以做到调用不同方法,使用不同的数据源吧。但@Datasource在类上并不起作用,对吧。

@shook2012
Copy link

@Datasource定义在子类的方法上时; 执行CrudRepository父接口的方法时,切面获取不到子接口的@Datasource注解?!

@easybest
Copy link
Owner Author

有bug

@easybest
Copy link
Owner Author

如果你有思路 可以给个PR

@shook2012
Copy link

我重写了MultipleDataSourceAspect,不同的datasource的repository放在不同的包,在MultipleDataSourceAspect根据包路径切面来切换数据源了...这个方案可行,但不算是通用方案。

@easybest
Copy link
Owner Author

AOP不是问题,关键是事务

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

No branches or pull requests

3 participants