[jboss-user] [EJB 3.0] - Re: ClassCastException when trying to merge an entity bean

fbenvegna do-not-reply at jboss.com
Tue Jul 31 02:22:49 EDT 2007


We have same error with Seam 1.2.1-GA and JBoss 4.0.5-GA.
Our problem was double assignment in @OneToOne relationship.


  | A a = new A();
  | B b = new B();
  | a.setB(b);
  | b.setA(a);
  | 

Solution:
set the the relationship only to the object that own the mapping (table with foreign key)


  | A a = new A();  // if A has mapping
  | B b = new B();
  | a.setB(b);
  | // b.setA(a); 
  | 



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

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



More information about the jboss-user mailing list