Skip Headers

# Configuring a Primary Mapping Project

Previous

Next

The mapping project contains your TopLink mapping metadata (see "Understanding Projects"), including descriptors and mappings. Each session is associated with at least one project so that the session can register the descriptors.

Table: Session Support for Primary Mapping Project summarizes which sessions support a primary mapping project configuration.

Session Support for Primary Mapping Project

Session | Using TopLink Workbench | Using Java
--- | --- | ---
Server and Client Sessions |  |
Session Broker and Client Sessions |  |
Database Sessions |  |

Using TopLink Workbench, you can export your mapping metadata as either a deployment XML file or as a Java class. Consequently, in a session, you can specify the mapping project as an XML file or as a Java class.

Oracle recommends that you export your mapping metadata from TopLink Workbench as a deployment XML file (see "Exporting Project Information").

If you export your mapping metadata as a Java class, you must compile it and add it to the session configuration classpath (see "Configuring a Sessions Configuration") before adding it to a session.

Note:

When specifying the mapping project using XML, you can specify the Java resource path. In most applications, the `sessions.xml` and `project.xml` files are deployed inside the JAR file, and the project XML path is specified as a Java resource path.

When specifying the Java resource path, ensure that you are using the forward slash character ( / ) for directories, not the back slash ( \ ). For example, `com/myapp/mypersistence/my-project.xml`, or `META-INF/my-project.xml`.

See "Configuring Multiple Mapping Projects" for information on configuring additional TopLink projects for the session.