I am assuming the join on the server side is somehow "wiping" out the pieces data? But it retains the shipment data. In theory it should retain both? Any suggestions on how to get around this rather niche issue? I can of course send the entities separately but then there's no point in the tables being joined.
Your mapping is wrong. You have two sides of the bidirectional association, but in each side you declare a different CONS_NO foreign key field, so it gets duplicated. You should point to the other side of the association so Aurelius knows they belong to the same one.
Hi Wagner
Not sure what you mean? Both server and client databases already exist. The shipments and pieces tables are just a small part of a 60GB database. Both tables already contain data on both server and client. When the client shipment record is inserted with a new record it has a status that indicates it needs to be sent to the server shipment table and a new shipment record is inserted there. There are 5 other tables (Pieces being one of them) that are joined to the shipments table that should also be sent up to the server. So far, only the shipment entity contains data when it hits the server and any other joined entities are nil.
Hi
Yes I can confirm that everything on the Client side is as it should be. Forgot to mention this is a Firebird 3 database, there are some subtle differences with triggers on the server end and some fields that exist on the server but not the client, but I have used directives for those eg {$IFDEF SERVERAPP} 'entity field' {$ENDIF}. I am going to test sending from client database to another client database to see if the issue is indeed on the server database. Will update shortly
Can confirm that the same issue exists when attempting to populate client to client as when trying to populate client to server.
As shown in the above screen shots, cons_no "0000006193" has 2 pieces records before being sent to the server. At the server end cons_no "0000006193" has no pieces records...
Hi Wagner
Sorry for the lack of instruction. This is taken from the firedac sql demo in the TMS Demos. There isn't any real visual feedback in terms of grid data etc.
Double click the XDataFireDacSqlServer.exe from the debug folder.
Run the XDataFireDacSqlClient in debug in Delphi and set a breakpoint on:
Hi Wagner
Thank you so much that works with a constructor.
Just a note I had created these entities with the right click of the Aurelius Connection and selecting the menu "Generate Entities from Database" No constructor was added to the unit.
However when I do this with TMS data modeller it does add the constructor to the unit.
This works with either ManyValueAssociation declaration
It created them in ship pieces but not in shipments, so yes I had to add them as foreign keys myself.
Either way. Many thanks your speedy assistance, I am happy to mark this as closed