0

I am using guice persist which relies on me listing my persistence units in a persistence.xml. As far as I can tell, there is no way to pass PersistenceUnitInfo at runtime to guice-persist.

However, where I have multiple databases, I have the models in separate projects and therefore want separate persistence.xml files.

Is there a way I can get maven to join these for me at compile time to avoid me having one file with all my persistence units in?

Cheetah
  • 13,785
  • 31
  • 106
  • 190

1 Answers1

0
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">

    <persistence-unit name="de.cware.cweb.projects.ee.user">
        <class>de.cware.cweb.services.user.model.JpaUserImpl</class>
    </persistence-unit>
    <persistence-unit name="de.cware.cweb.projects.ee.role">
        <class>de.cware.cweb.services.role.model.JpaRoleImpl</class>
    </persistence-unit>
</persistence>
Gangaraju
  • 4,406
  • 9
  • 45
  • 77
  • 2
    I don't think this answers how to deal with multiple of those files. Regardless, you should always add a few explaining words to your answers. – zapl May 26 '16 at 11:44