jaystack / jaydata

Notice: this library isn't maintained anymore
http://jaydata.org
GNU General Public License v2.0
352 stars 94 forks source link

How to determine the order in $batch operation #244

Open RichardSilveira opened 8 years ago

RichardSilveira commented 8 years ago

I have one special one-to-one relationship between two entities, what means that odata metadata can´t help me in this case...

So...when my $batch operation is dispatched i have the order in wrong way, i would like to invert (or to control) this order...

I do have only one "FreeShipping" for one "Delivery", but "Delivery" should be saved first, because he is the "parent" is this scenario...the primary key is IDDeliveryHash.

Can anyone help me, please?

POST FreeShipping HTTP/1.1 Content-ID: 1 Accept: application/json;q=0.9, /;q=0.1 OData-Version: 4.0 Content-Type: application/json OData-MaxVersion: 4.0

{"IDFreeShippingHash":".","Message":"lorem ipsum...","IDDeliveryHash":"."} --changeset_b3fb-b32e-156d Content-Type: application/http Content-Transfer-Encoding: binary

POST Delivery HTTP/1.1 Content-ID: 2 Accept: application/json;q=0.9, /;q=0.1 OData-Version: 4.0 Content-Type: application/json OData-MaxVersion: 4.0

{"IDDeliveryHash":".","Type":1,"IDProductHash":"tVZothgnCgdi8EQuyBbvGQ2"} --changeset_b3fb-b32e-156d--

PeterAronZentai commented 8 years ago

What jaydata version were you using? Batch operations got a major rework in 1.5 ctps. There is also support now for deep tree inserts in the latest preview. The fastest way to have a use case fixed/added if you create a failing test in a simple nodejs or html page project you share with us. We always deal with cases that are prepared to that level.