• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clarification for Java Persistence with Hibernate

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In chapter 6.4 of JPwH (Mapping a parent/children relationship), should the setter Bid.setItem() be something like this:
instead of just


I mean my setter should manually remove any existing associations before creating new ones. The examples given by the book don't do this. I just wondering if this is a careless omission rather than a deliberate action for some reasons I don't know about.

[ May 29, 2008: Message edited by: Alec Lee ]
[ May 29, 2008: Message edited by: Alec Lee ]
 
Bhavik Patel
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
inverse=true falg decides which end should manage the association. if Item class is managing the association then it should make sure that association with child is updated when we modify the Item
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic