OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (ODATA-666) Define Deep Update and Deep Upsert operations


    [ https://issues.oasis-open.org/browse/ODATA-666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61285#comment-61285 ] 

Steven Legg commented on ODATA-666:
-----------------------------------

If the intent is indeed that existing related entities that are not included in the request are to be unrelated/deleted then the proposed text should say something about it, in particular that preexisting related entities that are not included are deleted if the navigation property is a containment navigation property and unlinked if the navigation property is a non-containment navigation property.

However, this behaviour is inconsistent with the bind operation which only adds links (something that irks me, BTW). The use of entity references is wrapped up with the description of the bind operation, which implies that a navigation property whose values are only entity references is also only describing added links. As described this navigation property does not have the bind annotation, so we would have the odd situation that if the navigation property contained objects that were all entity references then they are only added links, but if the objects were all entities then omissions are treated as removed links.

I would rather see a navigation property with a collection of entity references distanced from the bind operation and treated in a manner consistent with a collection of entities (which also makes it consistent with non-navigation collection properties). In this way it would also be possible to mix entity references and entities in the same collection. Any entity that is no longer included, either as an entity or entity reference, is removed from the collection. Any entity that is included as an entity reference is retained without changes if it was already related or added as a member if it wasn't. It is an error if the new reference does not identify an existing entity. Any entity that is included as an entity is updated if it is already related and upserted otherwise. Thus any entity that is to remain in the collection without any changes can be compactly represented as just an entity reference.

As an aside, I find the assertion that the bind operation adds links incompletely specified. I haven't seen a statement anywhere that navigation properties cannot hold duplicate references to the same entity. There are pragmatic reasons why they shouldn't, but it isn't explicitly stated anywhere that I can see. If one assumes that duplicate references are allowed then the bind operation could be treated as always adding all the references, creating duplicates if necessary. If one assumes that duplicate references are not allowed then the bind operation should say that only new references are added; existing references are unaltered.

> Define Deep Update and Deep Upsert operations
> ---------------------------------------------
>
>                 Key: ODATA-666
>                 URL: https://issues.oasis-open.org/browse/ODATA-666
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: Implementing OData, OData ATOM Format, OData JSON Format, OData Protocol
>    Affects Versions: V4.0_OS
>         Environment: Set Operations; [Proposed]
>            Reporter: Ralf Handl
>            Assignee: Ralf Handl
>              Labels: AdoptionBlocker, Usability
>             Fix For: V4.01_WD01
>
>
> Similar to Deep Insert allow including nested entities that may already exist, in which case they are updated.
> Also allow nested "tombstones" to remove entities.
> Allow entity references to just create relations as an alternative to odata.bind (in the long run: retire odata.bind and use references everywhere).
> Use odata.etag annotation for conditional update of nested entities.



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]