Hi,

you mean you want to remove the child from all buyers, but keep the child?

Then your code should be (last two lines are changed):
Vendor child = this.manager.getReference(Vendor.class, vendorid );
  | 
  | Collection listParents = child.getBuyers();
  | Iterator iteratorParents = listParents.iterator();
  | while (iteratorParents.hasNext() == true)
  | {
  |   Buyer parentForChild = iteratorParents.next();
  |   parentForChild.getVendors().remove(child);
  | }
  | 
  | //remove ALL buyers from child:
  | listParents.removeAll();
  | 
  | //Now SAVE the child:
  | this.manager.persist(child);

Hope this helps

Wolfgang

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4190397#4190397

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4190397
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to