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 Advanced Properties

You can also specify the following advanced properties for each descriptor:

To display advanced properties:

Right-click a descriptor in the Navigator pane and choose Set Advanced Properties > specific property from the pop-up menu or choose Selected > Set Advanced Properties > specific property from the menu.

See "To Specify the Default Advanced Properties for Descriptors:" on page 2-12 for information on specifying default advanced properties.

Amending Descriptors After Loading

Some OracleAS TopLink features cannot be configured from the OracleAS TopLink Mapping Workbench. To use these features, you must write a Java method to amend the descriptor after it is loaded as part of the project. This method takes the descriptor as a single parameter. You can then send messages to the descriptor or any of its specific mappings to configure advanced features.

To a specify a method to execute after loading the descriptor:

  1. Select a descriptor in the Navigator pane. Its properties appear in the Editor pane.

    If the After load advanced property is not visible for the descriptor, right-click the descriptor and choose Set Advanced Properties > After Load from pop-up menu or from the Selected menu.

  2. Click the After load tab in the Editor pane.

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

Field Description
After Loading Specify whether the OracleAS TopLink Mapping Workbench should execute a method after loading the descriptor.
Class Click Browse and choose the class of the method to execute.
Static Method Use the Static Method drop-down list to choose the method to execute.

Specifying Events

Use the Events tab to specify a methods to execute when certain events occur.

To specify an event method:

  1. Select a descriptor in the Navigator pane. Its properties appear in the Editor pane.

    If the Events advanced property is not visible for the descriptor, then right-click the descriptor and choose Set Advanced Properties > Events from pop-up menu or from the Selected menu.

  2. Click the Event tab in the Editor pane.

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

Field Description
Events Choice Select an event for this descriptor.
Methods Select a method for each event.

Note: The methods available will vary, depending on the Event.


See "Registering an Event" for a complete list of events and methods.

Specifying Identity Mapping

The OracleAS TopLink Mapping Workbench specifies the default identity mapping for each descriptor in the project options (see "Working with Default Properties" on page 2-9). Use the Identity tab to specify identity map and existence checking information.


Note:

Changing the project's default identity policy does not affect descriptors that already exist in the project.

To specify an identity map for a descriptor:

  1. In the Navigator pane, select a descriptor.

    If the Identity advanced property is not visible for the descriptor, right-click the descriptor and choose Set Advanced Properties > Identity from the pop-up menu or from the Selected menu.

  2. Click the Identity tab.

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

Field Description
Type Use the Type drop-down list to choose the identity map (see Table 4–2 for details).
Size Size of the identity map.
Existence Checking Specify the method of existence checking.

Specifying Inheritance

Use the Inheritance tab to specify the descriptor's inheritance properties as either a root or subclass (branch class or leaf class).


Note:

When using an aggregate descriptor in an inheritance, all the descriptors in the inheritance tree must be aggregates. Aggregate and Class descriptors cannot exist in the same inheritance tree.

Creating a Root Class

Use this procedure to create a root class.

To specify a root class:

  1. In the Navigator pane, select the descriptor you wish to specify as the root.

  2. Choose the Inheritance tab in the Property pane.

    If the Inheritance tab is not visible, right-click the descriptor and choose Set Advanced Properties > Inheritance.

    Figure 4-20 Creating a Root Class

    Description of inhroot.gif follows
    Description of the illustration inhroot.gif

  3. To instantiate the descriptor's subclasses when queried, select the Read Subclasses on Query checkbox. Select a database view to use for reading subclasses if desired.


    Note:

    The view can be used for root or branch classes that have subclasses spanning multiple tables. The view must apply an outer-join or union all to the subclass tables.

  4. Select the Is Root Descriptor checkbox.

  5. You can use a class extraction method or a class indicator field to specify which class to instantiate on querying. Choose the option and select the appropriate method or field.

  6. If you use a class indicator field, you can use the class name as the indicator, or you can use a class indicator dictionary. Choose which option you wish to use and specify the necessary information.

  7. If you use an indicator dictionary, choose the indicator type and set the indicator values for each subclass.


    Note:

    A list of subclasses and their indicator values appears when the subclasses have set their parent descriptor. Abstract roots are not in the list.

  8. If you want instances of the subclasses to be instantiated when the root class is queried, select the Read Subclasses on Query checkbox. Do not select this checkbox for leaf classes.

Creating Branch and Leaf Classes

After setting up the root class for inheritance, you must also specify properties for branch and leaf classes.

To create branch and leaf classes:

  1. In the Navigator pane, select the descriptor for which to specify inheritance information.

  2. If the Inheritance advanced property has not been added to the descriptor, right-click the descriptor and choose Set Advanced Properties > Inheritance.

  3. Click the Inheritance tab of the Editor pane.

  4. Ensure that Is Root Descriptor is not selected. The Parent Descriptor drop-down list is now enabled and the class indicator information is disabled.

    Figure 4-21 Creating Branch and Leaf Classes

    Description of inhbr_lf.gif follows
    Description of the illustration inhbr_lf.gif

  5. Choose the parent descriptor from the Parent Descriptor drop-down list. This may be the root class or a branch class.

  6. Select the Read Subclasses on Query option if this is a branch class and you want its subclasses to be instantiated when it is queried. Choose a database view for reading subclasses, if desired. Do not select this checkbox for leaf classes.

Specifying Optimistic Locking

Use the Locking tab to specify whether the descriptor uses optimistic locking.

To specify a descriptor's locking policy:

  1. In the Navigator pane, select a descriptor.

    If the Locking advanced property is not visible for the descriptor, right-click the descriptor and choose Set Advanced Properties > Locking from the pop-up menu or from the Selected menu.

  2. Click the Locking tab.

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

Field Description
Optimistic Locking Specify that the descriptor uses optimistic locking.
Database Field Select the correct database field used for optimistic locking.
Version Locking Specify that the descriptor uses version locking.
Timestamp Locking Specify that the descriptor uses timestamp locking.
Store Version in Cache Specify whether you want to store the version information in the cache.

Specifying an Interface Alias

Use the Interface Alias tab to specify a descriptor's alias. Each descriptor can have one interface alias. Use the interface in queries and relationship mappings.


Note:

If you use an interface alias, do not associate an interface descriptor with the interface.

To specify an interface alias:

  1. In the Navigator pane, select a descriptor.

    If the Interface Alias advanced property is not visible for the descriptor, right-click the descriptor and choose Set Advanced Properties > Interface Alias from pop-up menu or from the Selected menu.

  2. Click the Interface Alias tab.

    Figure 4-23 Interface Alias Tab

    Description of intralis.gif follows
    Description of the illustration intralis.gif

  3. Click Browse and select an interface.