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

When to do bi-directional associations - Hibernate

 
Andles Jurgen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When to do bi-directional associations? For example, an auction Item/Bid one-to-many relationship, why would the Bid need to know about the Item?
Could I not just manage the bid via the Item class?

I guess what I am asking is "Which types of cases require a bidirectional relationship and why?"

While I am at it - could anybody put a plain english spin on what the 'inverse' attribute is all about? More interestingly, what would be the ramifications of not using the 'inverse' attribute in a case that shoud really use it - my understanding is that Hibernate would simply worl less efficiently asit would do 2, instead of 1, SQL query?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic