springmvc中如何同时使用两个mongodb数据库
PHPz
PHPz 2017-04-28 09:03:32
0
1
618

可以指定实体类对应的是哪个数据库中的表吗?

PHPz
PHPz

学习是最好的投资!

reply all(1)
滿天的星座

Configure two data sources, and use one of the following two solutions, which can also be used in combination:
1. Customize annotation classes, annotate specified methods in the service layer, and use spring aop to perform aspects to control the data source
2. Implementation Dynamically switch data sources and use spring aop for slicing to control the data source

Reference: http://www.boboface.com/wiki, DB reading and writing are separated in the wiki tree. As for how the program connects to mongodb, you can find out by yourself. This is just to give you ideas on how to solve your problem

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template