...
Note | |||||||||
---|---|---|---|---|---|---|---|---|---|
1. The below XML content illustrate the use of the element.
|
<provider>
The provider element specifies the name of the persistence provider's javax.persistence.spi.PersistenceProvider
class. The provider element must be specified if the application is dependent upon a particular persistence provider being used. The provider class supplies EntityManagers for this persistence unit.
...
- Object/relational mapping XML file named orm.xml may be specified in the META-INF directory in the root of the
persistence unit.
- Object/relational mapping XML file named orm.xml may be specified in the META-INF directory of any jar file
referenced by the persistence.xml.
- In addition, other mapping files may be referenced by the mapping-file elements of the persistence-unit
element, and may be present anywhere on the classpath.
An orm.xml file or other mapping file is loaded as a resource by the persistence provider. If a mapping file is specified, the classes and mapping information specified in the mapping file will be used. If multiple mapping files are specified (possibly including one or more orm.xml files), the resulting mappings are obtained by combining the mappings from all of the files. The result is undefined if multiple mapping files (including any orm.xml file) referenced within a single persistence unit contain overlapping mapping information for any given class. The below XML fragment illustrates the usage.
...
- The class element is used to list a managed persistence class. A list of all named managed persistence classes must be specified in Java SE environments to insure portability.
*Portable Java SE applications should not rely on the other mechanisms described here to specify the managed persistence classes of a persistence unit. - Persistence providers may also require that the set of entity classes that are to be managed must be fully enumerated in persistence.xml.
The following procedure explains how managed persistence classes are searched.
...
Note | |||||||||
---|---|---|---|---|---|---|---|---|---|
The above properties are specific to OpenJPA provider. The OpenJPA provider reads these properties and creates appropriate EntityManagerFactory. The properties supported by OpenJPA is at this link |