Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

When to do bi-directional associations - Hibernate  RSS feed

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?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!