You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Slavomír Bavala (Jira)" <ji...@apache.org> on 2020/01/10 14:08:00 UTC

[jira] [Commented] (OLINGO-1401) Add ability to write navigation properties when contentonly set to true

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

Slavomír Bavala commented on OLINGO-1401:
-----------------------------------------

Hi [~josephli2733], we are facing exactly the same problem as you do.

We tried to overcome this by setting {{conentOnly}} to _false_, but that required us to write few hacks so metadata generation won't fail when key properties are not specified etc.

Did you manage to perform a deep insert with multiple levels with {{contentOnly}} set to _false_?

> Add ability to write navigation properties when contentonly set to true
> -----------------------------------------------------------------------
>
>                 Key: OLINGO-1401
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1401
>             Project: Olingo
>          Issue Type: Improvement
>          Components: odata2-core
>    Affects Versions: V2 2.0.11
>            Reporter: Joseph Li
>            Priority: Major
>
> Client use case:
> EntityProvider.writeEntry(resultContentType,entitySet, postData, properties)
>  
> Currently, to POST a new entry where the ID is server generated we can set the contentOnly flag to true.
> But if contentOnly flag is true, [navigationProperties are skipped|https://github.com/apache/olingo-odata2/blob/e8ec21c40efe29c9ac0aaee507e905ff69dc249c/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducer.java#L89] and only additionallinks are written.
> This is preventing us from performing deep inserts where the related entity also have IDs that are server generated.
> Can we create an option where navigation properties can still be written if contentOnly is set to true?
> An example of the JSON that we are trying to create:
> {code:java}
> {
>   "Name": "Base Level",
>   "Child": {
>     "results": [
>         "Name": "Level 1",
>         "Grandchild": {
>           "results": [
>               "Name": "Level 2"
>             }
>           ]
>         }
>       }
>     ]
>   }
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)