[jboss-user] [EJB 3.0] - delete object from jointable

mravikrish do-not-reply at jboss.com
Wed Nov 19 01:15:15 EST 2008


  Hello,
    I am Ramu. I am having a problem with deleting objects from join table (many-to-many) relationship.my code is as follows

 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);
		 }
		   
		 this.manager.remove(child);	

  but it is deleting the child object  from parent table also. i want to delete only from join table not from original table . any help appreciated.

Thank u
Ramu

 

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4190326



More information about the jboss-user mailing list