• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to delete many side objects in merge operation?

 
Nalaka Gamagelk
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In My application I have one to many relationshp between Author and Book classes.
Author 1---->* Book. I have done the mappping as follows;

Book.java


Author.java



I am using merge operation for updating detached objects. When ever I am updating or adding Book objects and Merging the Author object, changes are reflected in the database. However when I client have remove Book object (Say in the database there are three books related to Author, But now I am caling merge operation with two Books objects with matching pk in the collection.

But I do not see missing Book object being deleted from the Book table. Can someone help me explaining how to do this. Is there any way to remove books (many side) without explicitly deleting those. i.e. By Merging Author object.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic