![](/img/trans.png)
[英]How to use same Persistence Unit to access different datasources with the same entities using EntityManager and EntityManagerFactory
我目前正在使用 Java 17、Wildfly 25.0.1 和 JPA,超過 Hibernate 5.3。 我有一個應用程序使用映射的注釋和實體來訪問單個數據庫。 我正在使用帶有數據源的 PersistenceUnit,它工作正常。 我想要實現的是以編程方式選擇具有相同 PersistenceUn ...