Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused...

 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic