Siebel Enterprise Integration Manager Administration Guide > Common EIM Usage Examples > Other Examples >

Example of Setting Explicit Primary Mappings for Many-to-Many Relationships

Example of Setting Explicit Primary Mappings explains how to set an explicit primary for a one-to-many relationship. When setting a primary key for a many-to-many relationship, such as the relationship between Opportunities and Contacts, there is an intersection table to consider.

As an example, you can work with the primary S_OPTY.PR_CON_ID. First you import into S_CONTACT using EIM_CONTACT. Then you use EIM_OPTY to import into S_OPTY and the intersection table S_OPTY_CON, and explicitly set the primary S_OPTY.PR_CON_ID during this process.

The column definitions for one-to-many primaries are different from those of many-to-many primaries. In the case of a one-to-many primary, such as S_CONTACT.PR_EMAIL_ADDR_ID, the foreign key table and the primary child table are both defined as S_PER_COMM_ADDR, and the primary intersection table is empty. In the case of a many-to-many primary, such as S_OPTY.PR_CON_ID, the foreign key table is S_CONTACT, and both the primary child table and the primary intersection table are defined as S_OPTY_CON. The explicit primary mapping for S_OPTY.PR_CON_ID is under the table mapping of its primary child table, that is, S_OPTY_CON. It could be easy to mistake S_CONTACT as the primary child table for S_OPTY.PR_CON_ID and this could lead you to look for an explicit primary mapping. This explicit primary mapping would not be found, however, because S_CONTACT is not mapped in EIM_OPTY.

 Siebel Enterprise Integration Manager Administration Guide 
 Published: 05 January 2004