Skip Headers
Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2)
Part No. B15900-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Working with Project Properties

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.

Working with General Project Properties

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:

  1. Select the project object in the Navigator pane.

  2. Select the General tab in the Editor pane. The General tab appears.

  3. 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 add a new classpath entry, click Add Entries and select the directory, .jar file, or .zip file to add.

    • To remove a classpath entry, select the entry and click Remove.

    • To change the order of the entries, select the entry and click Up or Down.

    To create a relative classpath, select an entry and edit the path, as necessary. The path will be relative to the Project Save Location.


Mapping EJB 2.0 Entities

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.

EJB Descriptor icon.
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 the ejb-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.

Working with Sequencing Properties

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:

  1. Select the project object in the Navigator pane.

  2. Click the Sequencing tab in the Editor pane. The Sequencing tab displays.

  3. Use this table to enter data in each field:

Field Description
Sequencing Preallocation Size Default preallocation size. Default is 50.
Sequencing Type Specify whether the project uses:
  • OracleAS TopLink Default sequencing

  • The database's Native sequencing

  • Custom sequencing table

Custom Sequence Table Information Use these fields to specify a sequence name, the name field, and counter field. These fields apply only you select Use Custom Sequencing Table.

Working with Default Properties

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:

  1. Select the project object in the Navigator pane.

  2. Select the Defaults tab in the Editor pane. The Defaults tab displays.

  3. Use this table to enter data in each field:

    Field Description
    Identity Map Use the Type drop-down list to select the default identity map and its Size for descriptors in this project (see "Working with Identity Maps" on page 4-59).
    Existence Checking Specify the type of existence checking to use.
    Field Accessing Specify whether the descriptors use Method or Direct field accessing (see "Specifying Direct Access and Method Access" on page 4-71).
    Named Queries Specify if OracleAS TopLink Caches All Statements or Binds All Parameters for named queries. See "Named Queries" on page 4-14 for more information, including how to override this setting for specific queries.

Renaming Packages

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.

Working with Project Options

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.

To Specify Project Options:

  1. Select the project object in the Navigator pane.

  2. Click the Options tab in the Editor pane. The Options tab displays.

  3. 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.

Setting Default Advanced Properties

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:

  1. 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.

    Figure 2-8 Advanced Property Default

    Description of advprop.gif follows
    Description of the illustration advprop.gif

  2. Select each advanced property to display, by default, when creating and editing descriptors.

  3. Click OK.