Skip Headers
Dali Java Persistence Tools User Guide
Release 3.2
Release 3.2
  PDF
PDF
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Synchronizing classes
 
Next
Specifying additional tables
 

Managing the orm.xml file

When creating a JPA project, (see "Creating a new JPA project") you can also create the orm.xml file that defines the mapping metadata and defaults.

Eclipse creates the META-INF\orm.xml file in your project's directory:

Example 3-2 Sample orm.xml File

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

Related reference

Related tasks

Related concepts

Creating an orm.xml file

If you opt not to create an orm.xml file when you create a JPA project, you can create one using the Create ORM Mapping File wizard.

Use this procedure to create an orm.xml file:

  1. From the Navigator or Project Explorer, select File > New > Other. The Select a Wizard dialog appears.

    Figure 3-37 The Select a Wizard Dialog

    The Select a Wizard dialog with Mapping file selected.
  2. Select JPA ORM Mapping File and then click Next. The Mapping File page of the Create ORM Mapping File wizard appears.

    If you are using EclipseLink, you can select EclipseLink > EclipseLink ORM Mapping File.

    Figure 3-38 New Mapping File Location Page

    The Mapping File page.
  3. Select the name and location of your mapping file and click Next. The Mapping File Options page appears.

    Figure 3-39 New Mapping File Options Page

    New Mapping File Options Page
  4. Define the properties in the Mapping File Options page and click Finish. The orm.xml file appears in the src directory of the selected JPA project. You can manage the orm.xml file using the JPA Details view or through the XML Editor. See also JPA Details view (for orm.xml).

Related reference

Related tasks

Related concepts

Working with orm.xml file

You can work with the orm.xml by using the JPA Details view.

Use this procedure to work with the orm.xml file:

  1. Right-click the orm.xml file in the Project Explorer and select Open.

  2. In the JPA Structure view, select EntityMappings.

  3. Use the JPA Details view to configure the entity mapping and persistence unit defaults.

    Figure 3-40 JPA Details view for EntityMappings (orm.xml)

    JPA Details view for orm.xml file.
  4. Complete the fields on the JPA Details view (for orm.xml).

Related reference

Related tasks

Related concepts