Hi All- I am doing a batch save of a Parent object with many Child objects mapped as OneToMany in JPA, with cascade save. My identifiers are generated table, for both the parent and child. I have configured inserts and updates to be ordered (hibernate.order_inserts=true,hibernate.order_updates=true). What I am seeing is a batched insert of the Parents, a batched insert of the Children (minus the foreign key column), then updates for all the Children to add the FK. I don't understand this behavior, the FK is available at the time of inserting the Children so I'd have expected it to be inserted instead of triggering all the updates. Is there a way around this?
Thanks!
|