Working with the OData Model Element

Every OData model element will have sections and each section will have section headers and properties under them. For example, the entity object element will have:

  • Entity Sets
  • Properties
  • Navigation Properties

This section will guide you to understand the various functions available in the OData model element.

OData Model Elements

The OData model element is a graphical representation of the artifacts in the OData Model Editor. For example, the entity type OData model element has three sections with the following headers:
  • Entity Sets
  • Properties
  • Navigation Properties
Note The section header names cannot be modified.

Selecting an OData Element

You can move the OData model element by first selecting the shape.

  1. Left click inside the OData model element. Ensure to click on the borders, dividers or the object icon.

    The OData model element is selected and now you can move and position the shape inside the OData Model Editor as required.

Resizing the OData Model Element

The OData model element re-sizes automatically to accommodate additional properties, You can also resize the OData model element manually by selecting it and dragging the corners.

  • Select the OData model element and drag the corners to re-size the OData model element manually.

Expand and Collapse of Sections

The OData Model Editor provides an universal expand and collapse button on the tool bar to expand and collapse all the section headers of the objects in the OData model element. You can also expand and collapse the sections in the OData model element.

Table 1: Properties
Description Button Shortcut Keys
Expand All Ctrl + Alt + E
Collapse All Ctrl + Alt + C
  • Click the button on the tool bar to collapse all the objects in the OData Model Elements in the OData Model Editor.
  • Click the arrow head button in the expanded section header to collapse the sections:

  • Click the button on the tool bar to expand all the objects in the OData model elements in the OData Model Editor.
  • Click the arrow head button in the collapsed section header to expand it.

Context Pad

A context pad is provided for every OData model element to assist the user to perform some basic functions in the OData Model Editor with just a click. Just hover the mouse cursor on the OData model element to view the context pad

The context pad provides the following functions:

  • Delete - Click to delete the OData model element along with the related entities and associations.

  • Add Property- Click to add a simple property to the OData model element. See Adding Properties for more information.

  • Add Complex Property- Click to add a complex property to the OData model element.

  • Add Navigation Property - Click to add a navigation property to the OData Model Element.

  • Add Association- Click and drag the arrow to another entity to create associations between entity types.

This section describes the common options available in the context menu of the OData Model Elements. Some options are specific to OData Model Elements and are not addressed in this section.

  1. Right click on the header of the OData Model Element to open the Context menu.

  2. Do the following using the context menu of the OData Model Element:
    Table 2: Context Menu
    Context Menu Description
    Undo Create a new Entity Type/ Function Import Use this menu to undo the most recent action performed in the OData model editor.
    Add Property Adds a property to the Properties. .
    Add Entity Sets Click to add a new entity set.
    Show Usages Use this menu to show and hide the all relationships of this function import with other artifacts on the canvas. The relationships are represented by arrows
    Delete Deletes the OData model element
    Export Diagram Use this menu to export and save the object as a diagram
    Diagram> Expand All> Collapse All  Use this menu to either expand all or collapse all the objects in the OData model element
    Layout Use this menu to choose the preferred layouts to layout the OData model elements in the OData model
    Print Use this menu print the diagram

Show/Hide All Usages

The objective of the Show/Hide All Usages button is to provide the user with the facility to view all the relationships between the artifacts on the graphical editor. Clicking the button in the when relationships are displayed will hide all the relationship(s). The Show/Hide button is a toggle button and can be located on the tool bar of the eclipse application and in the context pad of the objects. This button switches between two states; Show Usage (showing the relationship between the artifacts) and Hide Usage (hiding relationship between the artifacts). The appearance of the button changes with its state to provide visual assistance for the user.

Table 3: Show /Hide All Usages
Button State Description
Active When the Show/Hide Usage button has a box around it (pressed state) signifies that all the relationships between the artifacts in the graphical editor are being visible. You can press the button to hide the relationships.
Inactive When the Show/Hide Usage button appears without a box around it, then you can press it to view all the relationships between the artifacts in the graphical editor.
The following condition are adhered while using the "Show/Hide" button:
  • When an OData model is opened in the graphical editor and when the “Show/Hide All Usages” toggle button is pushed, the usage for all artifacts are shown in graphical editor canvas. The graphical editor switches to unsaved state & the button is in active state.
  • The relationship between the artifacts are shown by arrows.
  • Show usage will be available for entity types, complex types.
  • For complex types, if the same complex type is used in multiple properties in an entity, then link will be shown only to the parent entity. It is also applicable for entity types.
  • Show/Hide usage function is available for property usage and base type if the entity type and complex type.
  • Show usage is available for parameter usage and return type for function import.
  • When show usage is enabled, and if any changes are made in the properties view, the OData Model Editor reflects the changes instantly.
Note Whenever the Show/Hide All Usages toggle button is used, the graphical editor returns to the unsaved mode to maintain the state of “Show/Hide All Usages” toggle button. On saving & reopening the model file, the last state of the “Show/Hide All Usages” toggle button will be maintained.

Copy and Paste

This page will guide you to copy and paste the OData Model Elements in the OData Model Editor. The Copy & Paste function is available in the following scenarios:

  • Copy and Paste the OData Model Element anywhere in the same editor
  • Copy and Paste across OData Model Editors
  • Cascading Paste function - When pasting the OData Model Element on top of another OData Model Element, the elements are layered above another as cascades and does not overlap each other.

  • Copy and Paste of multiple OData Model Elements:
    • Select the OData Model Elements to be copied.
      Note: Ensure that only the OData Model Elements are selected and properties inside the element are not selected. If the properties are selected along with the elements then the paste will not work. Also, the entity sets cannot be copied.
    • Paste the copied elements in the same canvas on top of the copied elements.

      The elements are positioned as cascades on top of another element of the same type.

      If you paste the copied elements elements anywhere in the same canvas or in another canvas, then the elements are pasted as follows:

      Note Drag and drop function to copy and paste the OData Model Element in the OData Model Editor is not supported.
To Copy and Paste OData Model Elements follow these steps:
  1. Click on the empty region in OData Model Editor and select Paste or press Control+V from the keyboard.

    The copied OData Model Element will be pasted as positioned.

    Note: For copying properties, select the OData Model Element or anywhere in the element to paste the property and then paste the property.

  2. During a copy and paste process the following condition are met:
    • The new OData Model Element that was copied will have a unique name.
    • All the Properties and their attributes from the source entity will be copied to the destination entity with the same names and same attributes values.
    • Associations, Navigation properties will not be be copied to the destination Entity type element.
    • Only default Entity Set will be created in the copied Entity element.
    • A copied property will be pasted at the end of properties list in the new property element.The name of the property will be prop<N>, where "N" will be incremented every time you paste the same property and the name of the property will be in edit mode.The attributes of the property should be same as source property.
    • For copy of Property from EntityType to ComplexType , if, the source property is Key property then the destination property pasted in ComplexType should not be a key property.
  3. Using the mouse, select the required OData Model Element and select Copy or press Control+C from the keyboard.Shortcut Keys
The table below provides the list of shortcut keys that can be used in the OData Model Editor:
Table 4: Show /Hide Usage
Action To Shortcut Key
Navigation Left between the OData Model Elements Left arrow
Navigate right between the OData Model Elements Right arrow
Navigate down within the OData Model Elements Down arrow
Navigate up within the OData Model Elements Up arrow
Navigate into a section in the OData Model Element Alt+Down arrow with the OData model element selected
Navigate out of a section in the OData Model Element Alt+Up arrow
Cycle through an OData Model Element Select the OData model element and press the period key
Move an OData Model Element Cycle once to the Move handle using the period key. Use navigation keys to move. Press Enter to accept new location. Press Escape to cancel the move
Resize an OData Model Element Cycle to desired resize handle using the period key. Use navigation keys to resize. Press Enter to accept new size. Press Escape to cancel the resize
Cycle through connections Slash or backslash while on an element with connections
Select multiple Hold down Ctrl. Use navigation keys to navigate to additional OData model element. Press Space to select additional shapes or deselect already selected ones.
Select in sequence Hold down Shift, use navigation keys to select additional shapes or deselect already selected ones.
Go from OData model editor to palette Shift + Tab
Go from palette to OData model editor Tab (currently only works with active selection tool)
Create selected palette element RETURN
Create relation between OData Model Element Apply multi selection to the OData model element with SPACE. Navigate to palette with Shift + Tab and create the desired relation with RETURN

Things to Remember

  • While working with version control system, OData model may be in Read-only mode. Following are the characteristics of a Read-only OData model:
    • Read-only tag appears along with the title of the model.
    • Editor palette does not appear.
    • User can perform actions such as move the entities, show/hide relation, collapse etc.
    To edit the model, ensure OData model is in Write mode and reopen the editor.
  • Whenever a change is made on the canvas the OData Model Editor displays a star icon in the tab page of the OData Model Editor indicating that the model needs to be saved.

    • Select and press F2 to edit any objects in the entity shape.
    • On saving the model, an error icon displays on the elements that are erroneous and also in the OData Model Editor.

      Multiple elements and attributes can be deleted by either using CTRL key or SHIFT key and selecting the objects. A delete confirmation window appears during such operations.