cancel
Showing results for 
Search instead for 
Did you mean: 

How do you add a collection of values to an entity?

Former Member
0 Kudos

Hi,

I am currently working on updating my odata model provider used in netweaver gateway.

I am trying to add a collection of values to an entity as described in section 7.3 of the OData documentation here: http://docs.oasis-open.org/odata/odata-json-format/v4.0/cos01/odata-json-format-v4.0-cos01.html#Coll...

Another way to describe what I am trying to do is to include an array of n properties within an entity.

Has anyone done this or something like it? I know that I can create an association and link to another entity set, but would prefer to embed a list. Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Hi Brian,

IMO, SAP NW Gateway does not support arrays as property values yet.

I feel that this might be characteristics of latest OData specifications, and only a future enhancement at SAP Gateway can support it.

, your opinions please.

-Krishna

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Krishna and Brian,

Collection-valued properties are a feature of OData 4.0 that is not present in OData 2.0.

Gateway at the moment only supports OData 2.0, so you have to use navigation properties and separate entities instead.

Note that OData 4.0 collections aren't arrays: there's no way to address a single item in the collection, so you can't read or update individual items, and you can't append to a collection. So collections will always go over the wire as a whole, they are "structured large objects".

Consequently if the items in your collection have a natural key (which they typically do if they are stored as rows in a database table), the natural model is as separate entities and a navigation property of cardinality *.

Hope this helps

--Ralf

Answers (0)