Selecting and Importing Tables

Oracle JCA Adapter for Database 9-13 Figure 9–11 The Adapter Configuration Wizard: Define Primary Keys Page The primary key that you specify here is recorded on the offline database table and is not persisted back to the database schema; the database schema is left untouched. See Section 9.2.7, Creating Relationships to continue using the Adapter Configuration Wizard.

9.2.7 Creating Relationships

Figure 9–12 shows the relationships defined on the root database table and any other related tables. You can click Create Relationships… to create a new relationship Note: Note that Oracle Database Adapter only supports tables where there is a primary key defined. If primary key constraints have not been defined on a table explicitly, then you must provide one at design time while defining the Oracle Database Adapter by using the Adapter Configuration Wizard. If you do not provide a valid primary key, then the unique constraint is not guaranteed, and this could result in possible loss of messages at run time. That is, rows with duplicate primary key values are likely to be lost. To obtain a sample that describes how to use the row id field as primary key, access the Oracle SOA Sample Code site, and select the Adapters tab. Note: Oracle recommends that you use varchar instead of char for primary key columns, otherwise you will need to set the weblogic-ra.xml property shouldTrimStrings to false. The truncation of trailing spaces could cause the primary key to be read incorrectly, making it impossible to update read rows as processed. 9-14 Oracle Fusion Middleware Users Guide for Technology Adapters between two tables, or click Remove Relationship to remove it. To rename a relationship, click Rename Relationship. Figure 9–12 The Adapter Configuration Wizard: Relationships Page Note the following regarding creating relationships: ■ If foreign key constraints between tables already exist on the database, then two relationships are created automatically when you import the tables, a one-to-one 1:1 from the source table the table containing the foreign key constraints to the target table, and a one-to-many 1:M from the target table to the source table. ■ As Figure 9–12 shows, you see only the relationships that are reachable from the root database table. If, after removing a relationship, other relationships are no longer reachable from the root table, then they are not shown in the Relationships window. Consider the following set of relationships: A --1:1-- B --1:1-- C --1:M-- D --1:1-- E --1:M-- F 1 2 3 4 5 If you remove relationship 3, then you see only: A --1:1-- B B --1:1-- C If you remove relationship 2, then you see only: A --1:1-- B If you remove relationship 1, you no longer see any relationships. Figure 9–13 shows where you can create a new relationship.