I have an application with two databases and upon deployment I want to generate the tables for the entities in different two databases. For example if I have Entity1, Entity2 and Entity3, I want Entity1 and Entity2 tables to be generated in database1 and Entity3 table to be generated in database2. As in:
Entity1 =====> DB1
Entity2 =====> DB1
Entity3 =====> DB2
Is there a specific annotation that deals with database-entity mapping?
This is my persistence unit:
<persistence-unit name="DB1_PU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/DB1</jta-data-source>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables"/>
</properties>
</persistence-unit>
<persistence-unit name="DB2_PU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/DB2</jta-data-source>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables"/>
</properties>
</persistence-unit>