Hi,
     I am ramu, i am getting a problem when persisting data in many to many 
mapping.

vendor---->industry is many to many mapping

I am taking two industries objects and passing them to one vendor as a 
collection

Vendor v = manager.find(Vendor.class, 3);
                Industry i = manager.find(Industry.class, 2);
                Industry i1 = manager.find(Industry.class, 3);
                List l1 = new ArrayList();
                l1.add(i);
                l1.add(i1);
                v.setIndustries(l1);
                v.getIndustries().add(i);
                i.getVendors().add(v);
                manager.persist(v);

it is adding only one row in join table.but it should add two records for 
vendor 3

any help please
Thank you
KRamu


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

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

Reply via email to