I'd like to know what really happens when I do:
Person p1 = new Person();
...
p1.save()
in terms of cascades order of save-update.
Here there're some reasonings that I'd like to know if they're correct:
a) If Person have at least one relationship with 'inverse=false' (default), it will do all the cascades first and finally persist p1 itself. (Because it could be that the FK identity is not yet known)
b) If Person have all relationships with 'inverse=true', it could save p1 first and then do the cascades.
c) Suppose we have a Person<-->Car one-to-one bidirectional relationship and in both we have 'inverse=false' and 'save-update' cascade:
c.1) What would happen?. It seems like a infinite loop situation.
c.2) The correct solution is in Person doing 'cascade=save-update' with inverse=true, and in Car not doing cascade and inverse=false?
Maybe further links about the real logic behind the decision of the order of doing cascades and how the 'inverse' property is involved could help me.
Thanks in advance