JPA using multiple database schemas

前端 未结 6 1033
花落未央
花落未央 2020-12-01 05:13

I\'m having a bit of trouble with one particular issue using JPA/Spring:

How can I dynamically assign a schema to an entity?

We have TABLE1 that belongs to s

6条回答
  •  爱一瞬间的悲伤
    2020-12-01 06:04

    You could have two DataSource declarations (one for each schema) in your context.xml and define two persistence units using this datasources. The context.xml can then be different on the appservers of the different environments.

提交回复
热议问题