This kind of mapping in relational world is constructed using three tables. However, in object world only two classes are used for many-to-many. I have developed sample application - TopLinkMM.zip, that shows how many-to-many is supported in Oracle TopLink. For this sample I'm using Readers/Blogs mapping - one reader can read many blogs and one blog can be read by many readers.
SQL scripts for database schema are available in sample application lt.andrejusb.utils package under Model project.
Many-to-many mapping in Oracle TopLink is enabled by adding attribute with ValueHolderInterface type and corresponding accessors to the one of two classes involved into relationship. In developed sample I have added ValueHolderInterface type attribute - blogs, into Reader class. When accessors are created, it's time to enable many-to-many mapping using Oracle TopLink wizard in JDeveloper. To do this expand descriptor for Reader and double-click blogs element, this element is unmapped. When wizard dialog will be opened, set values for Reference Descriptor and Relation Table. Also, select - Private Owned and choose source and target references. General tab in mapping wizard should look like this:
If many-to-many will be successfully configured, JDeveloper will show appropriate icon for blogs attribue:
So, mapping is enabled, now we can test it. I have developed JUnit test suite, where insert and select is performed. Many-to-many test method code:
JUnit shows green light - there is no errors: