When you save an object of Portcall
, the complete state of the object is stored into the database. So if your fields previousPortCall
and nextPortCall
are defined as @Entity
as well, they will be stored automatically as the are part of the state of the Portcall
instance. You don't need to save them explicitly at all.
Secondly: As long as you store multiple objects within the same Transaction
, the order of storing does not matter, as the complete state will be atomicly visible in the database when the transaction is committed.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…