Oracle TopLink Developer's Guide
10g Release 3 (10.1.3) B13593-01 |
|
![]() 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 77-3 summarizes which sessions support a primary mapping project configuration.
Table 77-3 Session Support for Primary Mapping Project
Session | Using TopLink Workbench
|
Using Java
|
---|---|---|
|
|
|
Session Broker and Client Sessions |
|
|
|
|
|
Using TopLink Workbench, you can export your mapping metadata as either a deployment (Extensible Markup Language) 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.
See "Configuring Multiple Mapping Projects" for information on configuring additional TopLink projects for the session.
To specify the primary TopLink project metadata for your session, use this procedure:
Select a server or database session in the Navigator. Its properties appear in the Editor.
Click the General tab. The General tab appears.
Click the Project subtab. The Project subtab appears.
Figure 77-1 General Tab, Project Subtab, Primary Project Option
Select the following options:
Click Edit to define the primary project. The Edit PrimaryProject dialog box appears.
Select the Multiple Projects option to add additional projects to the session. See "Configuring Multiple Mapping Projects" for more information.
Figure 77-2 Edit Primary Project Dialog Box
Complete each field on the Edit Primary Project dialog box.
Use this information to enter date in each field on the dialog box:
Field | Description |
---|---|
XML | Select XML to add a mapping project as a deployment XML file. Click Browse to select the file. |
Class | Select Class to add a mapping project as a compiled Java class file. Click Browse to select the file. |
Using Java, you can register descriptors with a session using the following:
Project
API–Read your project.xml
file (or instantiate your project class) and create your session using Project
method createServerSession
or createDatabaseSession
.
Session
API–Add a descriptor or set of descriptors to a session using the Session
API that Table 77-4 lists. Descriptors should be registered before login, but independent sets of descriptors can be added after login.
Table 77-4 Session API for Registering Descriptors
Session Method | Description |
---|---|
|
Add to the session all the descriptors owned by the passed in |
|
Add to the session all the descriptors in the passed in |
|
Add an individual descriptor to the session. |