skip to main content
Formulating queries : Navigating relationships
 

Try DataDirect Cloud Now

Navigating relationships

Most data source types supported by DataDirect Cloud use relationships to define associations between tables or objects. In a relational data source, foreign key columns reference the primary key column of the related table. When you configure a schema map for a data source that contains relationships, DataDirect Cloud maps them as OData relationships. The OData model (returned via $metadata) identifies these as Navigation Properties. OData provides the following ways to access related entities:
*Resource Path navigation — fetch all related records or a specific record or property of that record.
*$Links — fetch all records for an entity and embed all related records in the response.
*$expand — return links to the related records for a specific entity.
DataDirect Cloud supports all three ways of navigating relationships. The topics in this section use an example of customers and orders with the following model:

Customer ---> Order ---> OrderItem
|
---> Contact
* Resource Path Navigation
* $expand query parameter
* $links Construct