Show TOC

Create Navigation PropertiesLocate this document in the navigation structure

This document describes creating Navigation Properties in the Service Builder project complying with OData V4.

NoteThe following image contains links to more information.
This document describes about the Service Builder projects that comply with OData V4, the development approach followed by it and its User Interface. This document describes creating an empty Service Builder project complying with OData V4. This document describes steps for creating Entity Types in Service Builder Project complying with OData V4. This document describes creating properties for an entity type complying with OData V4. This document describes creating Navigation Properties in the Service Builder project complying with OData V4. This document describes creating Entity Sets for the Service Builder projects complying with OData V4 This document describes defining Navigation Property Binding for the Service Builder projects complying with OData V4. This document describes creating complex types in the project complying with OData V4.
Context

The Entity Types include one or more Navigation Properties. Navigation Properties describe the navigation path between the relationship between two entity types. It is the property of an Entity that represents a link from the Entity to one or more related Entities.

Prerequisites

You should have already created an OData V4 project and an Entity Type.

Procedure
To create a Navigation Property for Entity Types, proceed as follows:
  1. Expand the Data Model folder in the tree view of your project.
  2. Expand the Entity Types subfolder and double-click on Navigation Properties subfolder to open the Mass Edit View.
  3. Click Display <-> Change to switch to edit mode
  4. Click Insert Row to insert a row or Append Row to append a row for creating a new navigation property.
  5. Do the following in the mass edit view for Navigation Properties:
    Table 1: Navigation Properties ALV

    Fields

    Description

    Name

    Enter a name for the Navigation Property

    Internal Name

    It is the internal name of the artifact. Internal Name is used by Gateway Runtime Framework to process a request internally. Maximum number of characters allowed in this field is 30. The name must start with an alphabetic character and must not contain special characters.

    Target Type

    The value of Target Type attribute can be either an Entity Type or collection of Entity Types. It determines the target for navigation.

    Collection and Nullable

    Collection and Nullable value define whether a navigation target is required for Navigation Property.
    • If Nullable is selected and Collection is not selected, it indicates that no navigation target is needed
    • If Nullable is not selected and Collection is selected, it indicates navigation Target is needed
    The Navigation Property whose Collection is selected cannot have Nullable selected and vise-versa. If Collection is selected, you cannot have Referential Constraint for the Navigation property.

    On Delete Action

    On Delete Action describes the action the service will take on related entities when the entity on which the navigation property is defined is deleted.
    • Cascade: the related entities will be deleted if the source entity is deleted
    • None: a DELETE request on a source entity with related entities will fail
    • Set Null: all properties of related entities that are tied to properties of the source entity via a referential constraint and that do not participate in other referential constraints will be set to null
    • Set Default: all properties of related entities that are tied to properties of the source entity via a referential constraint and that do not participate in other referential constraints will be set to their default value

    Partner

    The value of Partner attribute must be a Navigation Property contained in the Entity Type specified in the Target Type attribute. This is to define a bi-directional relationship between current Navigational Property and Navigation Property mentioned in Partner attribute.

  6. Click Save to save the changes made.

After creating Navigation Properties, you can Define Referential Constraints.