on 02-21-2014 11:35 PM
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.