Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2) Part No. B15900-01 |
|
Previous |
Next |
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.
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:
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.
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. |
Use the Events tab to specify a methods to execute when certain events occur.
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.
Click the Event tab in the Editor pane.
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.
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:
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.
Click the Identity tab.
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. |
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. |
Use this procedure to create a root class.
In the Navigator pane, select the descriptor you wish to specify as the root.
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.
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.
Select the Is Root Descriptor checkbox.
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.
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.
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. |
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.
After setting up the root class for inheritance, you must also specify properties for branch and leaf classes.
To create branch and leaf classes:
In the Navigator pane, select the descriptor for which to specify inheritance information.
If the Inheritance advanced property has not been added to the descriptor, right-click the descriptor and choose Set Advanced Properties > Inheritance.
Click the Inheritance tab of the Editor pane.
Ensure that Is Root Descriptor is not selected. The Parent Descriptor drop-down list is now enabled and the class indicator information is disabled.
Choose the parent descriptor from the Parent Descriptor drop-down list. This may be the root class or a branch class.
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.
Use the Locking tab to specify whether the descriptor uses optimistic locking.
To specify a descriptor's locking policy:
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.
Click the Locking tab.
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. |
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:
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.
Click Browse and select an interface.