If you modifying an object which has a bi-directional relationship, you do have to update both ends if you are adding or removing an item.
http://www.hibernate.org/hib_docs/re...-bidirectionalCode:category.getItems().add(item); // The category now "knows" about the relationship item.getCategories().add(category); // The item now "knows" about the relationship session.update(item); // No effect, nothing will be saved! session.update(category); // The relationship will be saved


Reply With Quote