This content has been marked as final.
Show 1 reply
-
1. Re: OneToMany relationship and CascadeType.PERSIST problem
srose Sep 30, 2005 10:22 AM (in response to epbernard)I tried your solution and it did not work because of the reasons here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=66309
Because the foreign key is part of the compositey key ,
the child.setPArent(parent);
has a insertable=false in the annotaion mapping the relationship.
As a workaround we create the parent first, then create all the children but this is taking up to 3 mins to create a record. It is weird because after you create the first record, the next one gets ceated in a couple seconds. Seems to only occur on the first insert. Any recommendations?