Hi
Probably I get a newbie error about relation design with xData
Using DataModeler + Aurelius + xData
DB = MySQL 8 using a MySQL 5.7 model
I create a relation like company / person with a foreign key between
When I create the first person (after creating a company entry) with relation to company using xData API using aurelius => All OK
with POST in Swagger as
Response is OK but...
In DB the existing link between company an first person entry is switch from 1 to null.
The value of foreign key in "person" table is set to null for existing entry (before it was equal to ID of company, here 1)
It seems working a one-to-one relation, in place of one to many, breaking previous with new one.
By direct DB update or insert, one-to-many works fine, so I guess it's something at aurelius level definition (probably through Data Modeler generator)
Your mapping is correct and it should behave as you expect. It makes no sense that it's clearing the company_id field in a totally unrelated person record.
I'm afraid I have to ask you to investigate more and if possible send steps to reproduce the issue, or maybe provide more details, as I believe the reason for the problem you are experiencing is not related to the info you provided here.