In our application we have multiple persistence units to support master data that is shared between applications and application specific data.
Previously, we had only one PU, so the entities are in the same jar.
Because of other requirements, the persistence.xml is located in another jar and thus references the jar that contains the entities like follows:
<persistence-unit name="PU1" > //config, e.g. connection to shared datasource <jar-file> ../entities.jar </jar-file> </persistence-unit> <persistence-unit name="PU2"> //config, e.g. connection to app specific datasource <jar-file> ../entities.jar </jar-file> </persistence-unit>