Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Within the root of the persistence unit.
  • Can be specified by reference in the persistence.xml by naming the classes, archives, or mapping XML files
    that are accessible on the application classpath.
  • Some combinations of the above methods.

Packaging

The persistence.xml file is placed in the META-INF directory of the root of the persistence unit.

Schema

The schema of the persistence.xml is at this link. Apache geronimo uses OpenJPA as the JPA provider.

Schema top level elements

The top level element of the persistence.xml is <persistence>. The below sections explain the sub-elements of the <persistence> element. Typical persistence.xml looks like below.

Code Block
XML
XML
borderStylesolid
titlepersistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
 http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
 ...
 ...
</persistence>