wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes When to do bi-directional associations - Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "When to do bi-directional associations - Hibernate" Watch "When to do bi-directional associations - Hibernate" New topic
Author

When to do bi-directional associations - Hibernate

Andles Jurgen
Ranch Hand

Joined: Mar 18, 2002
Posts: 67
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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: When to do bi-directional associations - Hibernate
 
Similar Threads
Associations in Hibernate
inverse attribute - too confusing !!!
Inverse Question
Hibernate Many to Many association does not update database
Exception while inserting a row using Hibernate