Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2) Part No. B15900-01 |
|
Previous |
Next |
When you select a database table in the Navigator pane, its properties appear in the Editor pane. Each database table contains the following property tabs:
Fields – Add or modify the table's fields, and specify the field's properties (see Figure 3–2).
References – Specify references between tables (see Figure 3–5).
Use the database table's Field tab to specify properties for the database table's fields.
Note: Some properties may be unavailable, depending on your database type. |
To Specify Table Field Properties:
Select a database table in the Navigator pane. The table's property sheet displays in the Editor pane.
Click the Fields tab.
Use this table to enter information in each field. Use the scroll bar to display all fields on the tab.
Field | Description |
---|---|
Name | Name of the field. |
Type | Use the drop-down list to select the field's type.
Note: The valid values will vary, depending on the database. |
Size | Size of the field. |
Sub-Size | Sub-size of the field. |
Allows Null | Specify if this field can be null. |
Primary Key | Specify whether this field is a primary key for the table. |
Identity | Indicates a Sybase, SQL Server or Informix identity field. |
Unique | Specify whether the value must be unique within the table. |
Note: Use the scroll bar to display the additional fields |
Enter the necessary information for the existing fields, or click Add Field to add a new field.
To remove a field, select the field and click Remove.
Use this procedure to set primary key(s) for a database table.
Note: The OracleAS TopLink Mapping Workbench can automatically import primary key information if supported by the JDBC driver. |
To Set a Primary Key:
Select a database table in the Navigator pane. Its property sheet appear in the Editor pane.
Click the Fields tab.
Select the Primary Key field(s) for the table.
References are table properties that contain the foreign key — they may or may not correspond to an actual constraint that exists on the database. The OracleAS TopLink Mapping Workbench uses these references when you define relationship mappings and multiple table associations.
When importing tables from the database, the OracleAS TopLink Mapping Workbench can automatically create references (if the driver supports this), or you can define references from the workbench.
Use this procedure to create a new table reference.
To Create a New Table Reference:
Select a database table in the Navigator pane. The table's properties display in the Editor pane.
Click the Table Reference tab (see Figure 3–5).
In the Table References area, click the Add button. The New Reference dialog box appears.
Use this table to enter information in each field.
Continue with Creating Field References.
Use this procedure to create a new field reference.
To Specify Table Reference Properties:
Select a database table in the Navigator pane. The table's properties display in the Editor pane.
Click on Table Reference tab.
Figure 3–5 calls out the following user-interface components:
Table References area
Key Pairs area
In the Table References area, select a Table Reference (see "Creating Table References").
In the Key Pairs area, click on Add button. The Source and Target fields appear on the tab.
Use the Source Field and Target Field drop-down lists to choose the key pair for this reference.