0

Is there a way to set the EclipseLink properties (e.g. target database) in a place different from persistence.xml?

Rational: I have a JPA module defining the data structure and containing persistence.xml. The module might be used with different target databases. In a Java SE application one can set the eclipse link properties programmatically upon creation of EntityManagerFactory. However, when the JPA module is packaged in an EAR for the Glassfish application server the target database must be defined in persistence.xml ... or is there another way?

Claude
  • 1,724
  • 3
  • 17
  • 46

1 Answers1

0

You can use a RESOURCE_LOCAL persistence unit and access it the same way through EntityManagerFactory.

James
  • 17,965
  • 11
  • 91
  • 146