Hi,
Following Aurelius manual example
about Master/Detail associations using dataset fields, I had build a
simple working sample and trying to post changes using XClient operations to
Xdata server with POST, PUT and DELETE operations.
My
Master Class uses a [ManyValuedAssociation([],
CascadeTypeAllRemoveOrphan)] for joining the detail Class, and I
implement OnCreateObject, onObjectInsert, OnObjectUpdate, onObjectRemove
handlers on the master aurelius dataset for XDataClient operations.
I
was Insert One Master record in master dbgrid and One Detail record in a
detail dbgrid, giving by hand the master primary key and in detail
record his own primary key and for the relation with the master record
the masterkey.
On the POST operation the result was that only a new Master record was inserted in
the DB ignoring the one detail but without any error message.
I
try to recall by XDataClient.List my previous inserted master record on the Grid and trying to
insert again the detail with PUT operationthis time. In that case I get the message "OPF Internal
Error: Cannot merge of Type <MyDetailClass>. Object with ID <value of My
new ID> does not exist.
I try to manually
insert
one detail record on the database and I repeat my test to delete the
master record with xclient.DELETE operation. The result is successful
and the master and detail record was deleted from db.
Last
I recall the Master/ and detail recs on the grids and try to update
again the existing master and detail records with Put operation on
master. The result was that the master and detail was successful update.
My
question is why XDataClient cannot insert new records on the detail
Class with POST or PUT operations with already provided keys and only
remove and update operations works as expected?
Thank you