I tried your solution and it did not work because of the reasons here:
Because the foreign key is part of the compositey key ,
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?