ObjectDB ObjectDB

Specify location of persistence.xml

#1

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...

edit
delete
#2

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
edit
delete
#3

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
edit
delete

Reply

To post on this website please sign in.