You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Amend (JIRA)" <ji...@apache.org> on 2016/07/27 08:47:20 UTC

[jira] [Commented] (OLINGO-924) Unable to link entity sets during write

    [ https://issues.apache.org/jira/browse/OLINGO-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15395255#comment-15395255 ] 

Christian Amend commented on OLINGO-924:
----------------------------------------

Hi,

if your service tries to update the link during a create but you don`t want this to happen you can set the "contentOnly" flag at the "EntityProviderWriteProperties" this will omit the navigation properties.

If you want to link the entities with this insert then you need to use the "additionalLinks" method at the "EntityProviderWriteProperties" there you can set the NavigationPropertyName as  the map-key and the key objects of your entity as the value. This way we will create the link you need.

This behavior is hidden because the V2 library was not intended to be used as a client and we made these changes later.

Best Regards,
Christian

> Unable to link entity sets during write
> ---------------------------------------
>
>                 Key: OLINGO-924
>                 URL: https://issues.apache.org/jira/browse/OLINGO-924
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>            Reporter: Gauri Kalra
>
> The OData end-point (SAP SuccessFactors, in this case) has two entity sets linked by a navigation property e.g. EmployeeTime linked to User via userIdNav property. When trying to insert a row into the former, Olingo sends the following request(only an excerpt from the request):
> "userIdNav":{"__deferred":{"uri":"https://apisalesdemo8.successfactors.com/odata/v2/EmployeeTime('cgrant1')/userIdNav"}}
> The operation fails with error:
> bad valueString [('cgrant1')/userIdNav] as part of keyString [('cgrant1')/userIdNav]
> The following is expected as part of the request(modified the above manually):
> "userIdNav": { "__deferred": { "uri": "https://apisalesdemo8.successfactors.com:443/odata/v2/User('cgrant1')" } }
> The entry gets inserted successfully when the above is sent as part of request. The navigation property in this case is marked "required". Hence, it is not possible to remove it from the request.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)