Specify location of persistence.xml


Is it possible to tell objectdb explicitly where the persistence.xml is located?

The background is that I am testing different persistence solution for a project, and as other Providers use also a persistence.xml I exceed the number of persistable classes, as I have one subproject for each persistence technology and somhow the jpa persistence.xml is read in also resulting in more than 10 persistec enabled classes. Only solution I found so far is to build my project only with objectdb and no other persistence providers. But for automated testing that is not really feasible...


You cannot specify a location of a persistence.xml file. It is always at META-INF/persistence.xml.

However, you can define several different persistence units in the same persistence.xml file. Use the provider element in the persistence unit to specify for each persistence unit a specific JPA provider (i.e. implementation).

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

You can also follow the JPAB approach and generate persistence units dynamically for every tested combination of a DBMS and a JPA implementation.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login