2.
Runtime Configuration

The OpenJPA runtime includes a comprehensive system of configuration defaults
and overrides:

OpenJPA first looks for an optional openjpa.xml resource.
OpenJPA searches for this resource in each top-level directory of your
CLASSPATH. OpenJPA will also find the resource if you place it within
a META-INF directory in any top-level directory of the
CLASSPATH. The openjpa.xml resource
contains property settings in
JPA's XML format.

You can customize the name or location of the above resource by specifying the
correct resource path in the openjpa.properties System
property.

You can override any value defined in the above resource by setting the System
property of the same name to the desired value.

In JPA, the values in the standard META-INF/persistence.xml
bootstrapping file used by the
Persistence class at runtime override the values in the above resource, as well as
any System property settings. The Map passed to
Persistence.createEntityManagerFactory at runtime also
overrides previous settings, including properties defined in
persistence.xml.

When using JCA deployment the config-property values in your
ra.xml file override other settings.

Note

Internally, the OpenJPA runtime environment and development
tools manipulate property settings through a general
Configuration interface, and in particular its
OpenJPAConfiguration and
JDBCConfiguration subclasses. For advanced
customization, OpenJPA's extended runtime interfaces and its development tools
allow you to access these interfaces directly. See the
Javadoc for details.