How to set a specific DataSource for a Repository?

前端 未结 4 1176
半阙折子戏
半阙折子戏 2021-01-04 18:43

Is it possible to assign a specific DataSource to a @Repository?

I\'d like to create a test environment where in general I want to use the

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-04 19:20

    well it depends on which is your design , cause there are different implementations that you can follow , f.e you can declare two beans for the two datasources and in your code specify to which one you want to hit , or else you could define two differents context and a shared context in which again you ll have to specify in your code which service you want to call. Here is an older question that might help you for the 1st approach

提交回复
热议问题