File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Many-to-many composite ID Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Many-to-many composite ID" Watch "Many-to-many composite ID" New topic

Many-to-many composite ID

Jonathan Huang
Ranch Hand

Joined: Jun 23, 2006
Posts: 35
Is there a way to map a many-to-many set that does not use the entire composite ID of the association.

Table1's PK = column1 + column2 + column3
Table2 only has column1 and column2 that associate to Table1.

For Example we have two mappings:

The code above throws a: "must have same number of columns as the referenced primary key (webquest.OTOSTLKPSCALE [JOB,SCLNAME,SCLPUNCH])" error.

Thanks in advance and I hope I was clear in describing my issue.
[ July 25, 2006: Message edited by: Jonathan Huang ]
Jonathan Huang
Ranch Hand

Joined: Jun 23, 2006
Posts: 35

Still having trouble figuring this one out!

I agree. Here's the link:
subject: Many-to-many composite ID
It's not a secret anymore!