How un-link two ONE to ONE related objects?

Hi you all,
I have the following table schema:

Car {
   name : STRING
   colour: STRING


Person {
   name : STRING,
   surname : STRING,
   car : Car [1 to 1 relation with Car table]

When I try to update the related object, via the console I need to “Unlink the related object”.</img></img>

    Can you explain why I need to do shuch a thing? Can't I just add the new Car object, without unlinking the old one? Can you show me please how can I do the same thing via Java code, if I want to update a record?
Thank you for your help! :)


In console you mustn’t unlink relation before setting new one. You can just select new radio button and press “Update Related Object” button.

You can know more about updating related records via Java code from this article.



Thank you for your answer!