Hi Chandan,

OData 4.0 explicitly disallows this: Deep Insert is allowed, but not Deep 
Upsert or Deep Update:

11.4.3 Update an Entity 
(http://docs.oasis-open.org/odata/odata/v4.0/cos01/part1-protocol/odata-v4.0-cos01-part1-protocol.html#_Toc372793719)

[...]

The entity MUST NOT contain related entities as inline content. It MAY contain 
binding information for navigation properties. For single-valued navigation 
properties this replaces the relationship. For collection-valued navigation 
properties this adds to the relationship.

[...]

The OData 2.0 specification is less explicit, but we shouldn't add things to 
2.0 that we know not to be allowed in 4.0

Regards!
--Ralf


-----Original Message-----
From: Amend, Christian [mailto:christian.am...@sap.com] 
Sent: Thursday, 16. January 2014 15:08
To: dev@olingo.incubator.apache.org
Subject: RE: Doubt on Deep Insert

Hi Chandan,

I too think both are valid use cases although the specification isn't clear 
about that. The core library already provides the processor with the data. So 
it is up to the application to make the update in their database or however 
they store their data. So in my opinion the JPA Processor has to decide here if 
this should be supported or not. Or if there is a way to leave this to an 
application to decide. Also the question is what status code to give as a 
response.

Best Regards,
Christian

-----Original Message-----
From: Klevenz, Stephan [mailto:stephan.klev...@sap.com] 
Sent: Donnerstag, 16. Januar 2014 14:37
To: dev@olingo.incubator.apache.org
Subject: Re: Doubt on Deep Insert

Hi Chandan,

This is a valid use case for HTTP where PUT is idempotent and can be used
to create or update resources. In my opinion OData does not disallow this
use case. Because of the customer already exists the return code has to be
204 [1].

< Stephan

[1] 
http://www.odata.org/documentation/odata-v2-documentation/operations/#26_Up
dating_Entries


On 16.01.14 14:08, "V.A, Chandan" <chandan....@sap.com> wrote:

>Hello All,
>I have couple of doubts with respect to Deep insert.
>
>
>1)      Can we perform an HTTP Put on an Entity with inline entries that
>are yet to be created?
>Say I have a Customer entity "A" already created. Now I update the
>customer entity (HTTP Put) with inline entries for Sales Order "S" which
>is not yet created.
>
>2)      Can we perform an HTTP PUT on an Entity with inline entries that
>are already created?
>Say I have a customer entity "A" already created. Now I update the
>customer entity (HTTP PUT) with inline entries for Sales Order "S" which
>is already created.
>
>Is this a valid use case as per OData specification. Because I could not
>find details about this in OData specification. Can someone please
>clarify?
>
>Thanks,
>Kind Regards
>Chandan VA
>

Reply via email to