[ 
https://issues.apache.org/jira/browse/OLINGO-1401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joseph Li updated OLINGO-1401:
------------------------------
    Description: 
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}
 

  was:
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?

 


> 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)

Reply via email to