[jboss-user] [EJB 3.0] - Re: ManyToOne and ManyToMany foreign key issues

wolfc do-not-reply at jboss.com
Tue Jul 11 02:39:39 EDT 2006


Please try the following:
Test1 t1=new Test1();
  | ArrayList<Test2> a=new ArrayList<Test2>();
  | Test2 t2=new Test2();
  | t2.setField(1);entityManager.persist(t2);a.add(t2);
  | t2=new Test2();
  | t2.setField(2);entityManager.persist(t2);a.add(t2);
  | t1.setTest2s(a);
  | t1.setField(1);
  | entityManager.persist(t1); 

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

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



More information about the jboss-user mailing list