Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2) Part No. B15900-01 |
|
Previous |
Next |
Use transformation mappings for specialized translations between how a value is represented in Java and in the database. The method takes a database row as an argument and is called whenever an object is written to the database. The method returns the value from the object that should be written to the field.
In the advanced tutorial, the transformation method corresponds to a single argument method on the Employee
class and extracts the values from the fields, placing them into the NormalHours
array.
To map the normalHours attribute:
Expand the Employee
descriptor in the Navigator pane.
Click the normalHours
attribute of the Employee
descriptor.
Description of the illustration trmapbtn.gif
Click the Transformation Mapping button on the mapping toolbar.
Use the Database Row -> Object Method drop-down list to select the bulidNormalHours method.
Click the Add button to create the following Object->Field Methods:
Database Field: START_TIME, Method: getStartTime
Database Field: END_TIME, Method: getEndTime
Description of the illustration savebtn.gif
Click Save on the toolbar or choose File > Save Project to save the project.