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 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: 2906
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 ]

"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confused...
 
Similar Threads
Voucher Question: 3 in one go?
This thread is open for hijacking
Your Photos
I have just resubmitted Servlets 1
Is there any training center in south India teaching snake catching?