aspose file tools*
The moose likes Object Relational Mapping and the fly likes Confused... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Confused..." Watch "Confused..." New topic
Author

Confused...

Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
I have a three tables, one of projects, one of developers, and one that relates the two. How would should I represent the last table in hibernate?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
In the mapping for class Project:


In the mapping for class Developer:


see 7.5.3. many to many

Of course in reality there would be some information attached to that association (begin, end, % commitment, etc.). In that case each row in the association table would be an "Assignment" object. Each project would have many developer assignments and each developer would have many project assignments (hopefully few simultaneous ones - but we are talking the real world here).
[ March 31, 2006: Message edited by: Peer Reynders ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confused...