cancel
Showing results for 
Search instead for 
Did you mean: 

OData Association

BenedictV
Active Contributor
0 Kudos

Hi,

I am trying to understand the basics of OData, and I keep coming back to this amazing document for reference:

I do not have a grasp on the Association yet. In this metadata:

http://services.odata.org/OData/OData.svc/$metadata

I see that the relation between Product and Category is defined by the association:

<Association Name="Product_Categories_Category_Products">

and by the navigation property defined in the Product and Category entities.


But where do we specify what fields of Product and Category should be joined?


Benedict

Accepted Solutions (1)

Accepted Solutions (1)

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

First you should understand about entity and entity set, then you can relate different 'wording' like product, products, category, categories

Best guide to learn: OData - the Best Way to REST

To look for association, you can use $expand verbs.

http://services.odata.org/OData/OData.svc/Categories?$expand=Products&$format=json

Regards,

JK

Answers (1)

Answers (1)

Hi,

in Referential constraint we can specify the fields which we want to join from two entities . I have taken two entity one is Zheader which consists of some fields like Id,Name,address which is my header entity and another entity Zitem which consists of fields like ID,EID,company is my Item entity, ID field of Zheader and EID field of Zitem I am joining like this we can specify the fields which we want to join.

ID(principle entity key), EID (Dependent property)