Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2) Part No. B15900-01 |
|
Previous |
Next |
Each project in the Navigator pane contains different editable parameters. To edit the project's properties, select the project object in the Navigator pane. The following tabs appear in the Editor pane.
General project properties (persistence type and classpath)
Sequencing table defaults
Default project properties (identity map, existence checking, and field access method)
Options (when generating Java source and creating Java information)
Use the project's General tab to specify the default persistence type and classpath information. Each OracleAS TopLink project uses a classpath — a set of directories, .jar
files, and .zip
files — when importing Java classes and defining object types.
To create a descriptor for a persistent class, the OracleAS TopLink Mapping Workbench reads a compiled Java .class file to read its attributes and relationships.
To Specify the General Properties:
Select the project object in the Navigator pane.
Select the General tab in the Editor pane. The General tab appears.
Use this table to enter data in each field:
Field | Description |
---|---|
Project Save Location | Location of the project's .mwp file and associated folders. This field is for display only. All relative locations are based on the Project Save Location.
|
Persistence Type | Specify the project's persistence type. For EJB projects, specify the location of the ejb-jar.xml file.
|
ejb-jar.xml Location | Location of the ejb-jar.xml file for this project. See "Mapping EJB 2.0 Entities" and "Working with the ejb-jar.xml File" for more information.
Note: This field applies for EJB projects only. |
Classpath | Location of the classes and packages for this project. See "Working with Classes" for information.
To create a relative classpath, select an entry and edit the path, as necessary. The path will be relative to the Project Save Location. |
You can create an OracleAS TopLink Mapping Workbench project based on information in the ejb-jar.xml file. Use this file to map the EJB 2.0 Container Managed Persistence (CMP) entity beans' virtual fields (called Container Managed Fields, defined by <cmp-field> tag) or relationships (called Container Managed Relationship, defined by <cmr-field> tag) to database tables. You must specify an .xml file or a .jar file that contains an ejb-jar.xml file.
Description of the illustration ejbicon.gif
The OracleAS TopLink Mapping Workbench defines all descriptors for entity classes (as defined in the ejb-jar.xml
file) as EJB descriptors. The OracleAS TopLink Mapping Workbench does not create (or remove) descriptors for the interfaces and primary key class for the entity when refreshing from the ejb-jar.xml
.
Note: The OracleAS TopLink Mapping Workbench creates class descriptors for entity classes not defined in theejb-jar.xml file. You must manually change the descriptor type (see "Specifying Descriptor Types" on page 4-2).
|
To update your project from the .xml
file, right-click an EJB descriptor and select Update Descriptors from ejb-jar.xml. You can also update the project by choosing Selected > Update Descriptors from ejb-jar.xml from the menu. See "Working with the ejb-jar.xml File" for more information.
Sequence numbers are artificial keys that uniquely identify the records in a table. Use the project's Sequencing tab to specify default sequencing properties for all descriptors in the project. See "Working with Sequencing" on page 4-36 for more information.
To Specify Default Sequencing Properties:
Select the project object in the Navigator pane.
Click the Sequencing tab in the Editor pane. The Sequencing tab displays.
Use this table to enter data in each field:
Use the project's Default tab to specify the default identity map, existence checking, and field access method.
Use the project's Default tab to specify the default:Identity map and existence checking policy for descriptors (if they do not have a specific identity policy)Field accessing applied to newly created descriptors
To Specify Default Project Properties:
Select the project object in the Navigator pane.
Select the Defaults tab in the Editor pane. The Defaults tab displays.
Use this table to enter data in each field:
To rename your packages, you must edit each of the project's associated .xml
files in the following subdirectories:
Class
ClassRepository
Descriptor
Package
You must also edit the package and class names in the .mwp
file. After changing the package names in all files, open the project in the OracleAS TopLink Mapping Workbench. OracleAS TopLink now uses the new package name.
Use the project's Options tab to specify the default file names, class names, and directories, when exporting or generating Java source code and deployment XML. In addition, you can specify the primary key name and primary key search pattern (database schema) to use when generating tables. The resulting tables and columns will conform to the naming restrictions of the project's target database.
Select the project object in the Navigator pane.
Click the Options tab in the Editor pane. The Options tab displays.
Use this table to enter data in each field:
Field | Description |
---|---|
Deployment and Java Source Code Generation | Specify the defaults to use when exporting project information. Directories are relative to the project location and will contain folders for each generated package. |
Project Java Source | Java class name and project root directory when generating Java source. See "Exporting Project to Java Source" for more information. |
Project Deployment XML | Filename (*.xml ) and directory when generating Java source. See "Exporting Deployment XML" for more information.
|
Table Creator Java Source | Java class name and project root directory when generating table source. See "Exporting Table Creator Files" for more information. |
Model Java Source | Project root directory when generating Java model source. See "Generating Java Code for Descriptors" on page 4-4 for more information. |
Table Generation |
|
Default Primary Key Name | Default name to use when generating primary keys. |
Primary Key Search Pattern | Default search pattern to use when generating primary keys. |
In addition to a descriptor's standard property tabs, you can specify advanced properties for each descriptor (see "Working with Advanced Properties" on page 4-26 for more information). You can also specify which of these advanced properties appear, by default, for new descriptors.
To Specify the Default Advanced Properties for Descriptors:
Right-click the project object in the Navigator pane and choose Set Advanced Property Defaults from the pop-up menu. The Advanced Property Defaults dialog box appears.
You can also set the default advanced properties by choosing the project object and choosing Selected > Set Advanced Property Defaults from the menu.
Select each advanced property to display, by default, when creating and editing descriptors.
Click OK.