Use the '''orm.xml''' file to apply the metadata to the persistence unit. This metadata is a union of all the mapping files and the annotations (if there is no '''xml-mapping-metadata-complete''' element). If you use one mapping '''orm.xml''' file for your metadata and place this file in a META-INF directory on the classpath, then you do not need to explicitly list it. The EclipseLink persistence provider will automatically search for this file ('''orm.xml''') and use it.

+

Use the <tt>orm.xml</tt> file to apply the metadata to the persistence unit. This metadata is a union of all the mapping files and the annotations (if there is no <tt>xml-mapping-metadata-complete</tt> element). If you use one mapping <tt>orm.xml</tt> file for your metadata and place this file in a <tt>META-INF</tt> directory on the classpath, then you do not need to explicitly list it. The EclipseLink persistence provider will automatically search for this file (<tt>orm.xml</tt>) and use it.

+

+

If you use a different name for your mapping files or place them in a different location, you must list them in the <code>mapping-file</code> element of the [[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Configuration/JPA/persistence.xml|persistence.xml file]], as shown here:

−

If you use a different name for your mapping files or place them in a different location, you must list them in the '''mapping-file''' element of the [[EclipseLink/UserGuide/JPA/Basic_JPA_Development/Configuration/JPA/persistence.xml|persistence.xml file]], as shown here:

<source lang="xml">

<source lang="xml">

<persistence-unit name="EmployeeService">

<persistence-unit name="EmployeeService">

Line 15:

Line 16:

</source>

</source>

{{EclipseLink_Note

{{EclipseLink_Note

−

|note=In this example, the '''orm.xml''' file is not listed -- the persistence provider finds it by default.

+

|note=In this example, the <tt>orm.xml</tt> file is not listed -- the persistence provider finds it by default.

Specifying Object-Relational Mappings Using orm.xml

Use the orm.xml file to apply the metadata to the persistence unit. This metadata is a union of all the mapping files and the annotations (if there is no xml-mapping-metadata-complete element). If you use one mapping orm.xml file for your metadata and place this file in a META-INF directory on the classpath, then you do not need to explicitly list it. The EclipseLink persistence provider will automatically search for this file (orm.xml) and use it.

If you use a different name for your mapping files or place them in a different location, you must list them in the mapping-file element of the persistence.xml file, as shown here: