I have a simple 4 entities(tables) structure:
a - columns: id(generated), x
b - columns: id(generated), a_id(fk to a), y
c - columns: id(generated), a_id(fk to a), z
d - columns: id(generated), b_id(fk to b), c_id(fk to c), w
relationships as follows:
a->b one-to-many unidirectional;
a->c one-to-many unidirectional;
b->d one-to-many unidirectional;
c->d one-to-many unidirectional
All relationships cascaded.
hibernate performs incorrect order of inserts when persisting a:
should be a,b,c,d
does: a,b,d and fails without having generated
How can I enforce the correct order?
However I can set b_id and c_id to nullable, but then I ,will have inserts and updates. I would like to avoid it.
Thanks
Mark
Set bi-directional to a-b, a-c and b-d. Saw some improvements but could not get rid of updates.
|