When to do bi-directional associations - Hibernate
posted 11 years ago
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?