File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Many-to-many composite ID Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Many-to-many composite ID" Watch "Many-to-many composite ID" New topic
Author

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
Anyone?

Still having trouble figuring this one out!

Thanks.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Many-to-many composite ID
 
Similar Threads
Hibernate - Force foreign key lookup on insert
Need many-to-one mapping help
Please suggest on this Mapping
Legacy and Hibernate1-2-M Mapping
Help with mapping set - Hibernate