Adding Many-to-Many Relationships to an RPS Mapping
The Many To Many Table Selection sheet of the Relational Population Service wizard enables you to select the many-to-many inverse properties in a JADE object model to an RPS database. This sheet is displayed only if the Show Many To Many combo box is checked on the Define RPS sheet in step 1 of the RPS mapping. (For details, see "Setting Up the RPS Options", earlier in this chapter.)
The many-to-many relationship is defined by creating a junction table in the relational database to split the m-n relationship in the JADE database into two 1-n relationships.
An example of the Many To Many Table Selections sheet is shown in the following image.
When this sheet is first displayed, only the collections that are on classes that have been mapped in the RPS mapping are displayed in the list at the left of the sheet.
To select the collections to map to junction tables
-
If you want to display all persistent classes in the selected schemas that have many-to-many collection mappings, check the Show All Available check box.
The junction table can be included in the RPS mapping even if the classes in the collections are not in the RPS mapping, although the table may be of limited use.
-
Select the required collection in the table at the left of the sheet, to create a junction table for the many‑to‑many relationship.
You only have to select one end of the many‑to‑many relationship for inclusion in the RPS mapping. If you include both ends, the information is duplicated in the two junction tables that are created.