jQuery in Action, 2nd edition*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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 ]
 
 
subject: Confused...
 
Similar Threads
Is there any training center in south India teaching snake catching?
I have just resubmitted Servlets 1
Voucher Question: 3 in one go?
This thread is open for hijacking
Your Photos