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 Database Tables in the Editor Pane

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:

Working with Field Properties

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:

  1. Select a database table in the Navigator pane. The table's property sheet displays in the Editor pane.

  2. Click the Fields tab.

    Figure 3-2 Fields Properties

    Description of fields.gif follows
    Description of the illustration fields.gif

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

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

Setting a Primary Key for Database Tables

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:

  1. Select a database table in the Navigator pane. Its property sheet appear in the Editor pane.

  2. Click the Fields tab.

    Figure 3-3 Setting Primary Key for a Database Table

    Description of fieldspk.gif follows
    Description of the illustration fieldspk.gif

  3. Select the Primary Key field(s) for the table.

Working with Reference Properties

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.

Creating Table References

Use this procedure to create a new table reference.

To Create a New Table Reference:

  1. Select a database table in the Navigator pane. The table's properties display in the Editor pane.

  2. Click the Table Reference tab (see Figure 3–5).

  3. In the Table References area, click the Add button. The New Reference dialog box appears.

  4. Use this table to enter information in each field.

Field Description
Name of New Reference Name of the reference table. If you leave this field blank, the OracleAS TopLink Mapping Workbench automatically creates a name based on the format: SOURCETABLE_TARGETTABLE.
Select the Source Table Name of the database table. This field is for display only.
Select the Target Table Use the drop-down list to specify the target table for this reference.
On Database Specify if you want to create the reference on the database when you create the table. Not all database drivers support this option.

Continue with Creating Field References.

Creating Field References

Use this procedure to create a new field reference.

To Specify Table Reference Properties:

  1. Select a database table in the Navigator pane. The table's properties display in the Editor pane.

  2. Click on Table Reference tab.

    Figure 3-5 References Properties

    Description of reftab.gif follows
    Description of the illustration reftab.gif

    Figure 3–5 calls out the following user-interface components:

    1. Table References area

    2. Key Pairs area

  3. In the Table References area, select a Table Reference (see "Creating Table References").

  4. In the Key Pairs area, click on Add button. The Source and Target fields appear on the tab.

  5. Use the Source Field and Target Field drop-down lists to choose the key pair for this reference.