Creating Many-to-Many Mappings

With the TopLink Mapping editor, you can create both unidirectional or bidirectional many-to-many (M:M) mappings between CMP EJBs. These mappings can be independent.


Note: In a bi-directional M:M relationship, one mapping must be set to read-only, to prevent both mappings from writing to the relation table at the same time.

Use this procedure to create a many-to-many mapping.

To create a many-to-many mapping:

  1. In the Structure window, select the attribute to be mapped.
  2. Enter the required information to define this mapping.
  3. Click the Many-to-Many Mapping - Collection Options tab.

    Figure 6-12 Many-to-Many Mapping Collection Options

    This is the text description of mmmapcol.gif.
This figure shows the Collection Options tab of a many-to-many mapping.

  4. Enter the collection information.
  5. Click the Many-to-Many Mapping - Source Reference tab.

    Figure 6-13 Many-to-Many Source Reference

    This figure shows the ource Reference tab for a many-to-many mapping.

  6. Select the source table reference.
  7. Click the Many-to-Many Mapping - Target Reference tab.

    Figure 6-14 Many-to-Many Source Reference

    This is the text description of mmtarget.gif.
This figure shows the Target Reference tab of a many-to-many mapping.

  8. Select the target table reference.

Related Topics

About CMP EJB Mappings
Working with CMR Relationship Mappings

 

Working with Many-to-Many Mappings

 

Specifying Advanced Features by Amending the Descriptor

 

Copyright © 1997, 2004, Oracle. All rights reserved.