Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1575

Remove restriction on Partner navigation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: V4.01_OS
    • Fix Version/s: V4.02
    • Component/s: CSDL JSON, CSDL XML
    • Labels:
      None
    • Proposal:
      Hide

      Replace the requirement with an explanation

      If a partner navigation property is specified, and this partner navigation property specifies the current navigation property as its partner, the two navigation properties define a bi-directional relationship. A partner navigation property may specify a navigation property different from the current navigation property.

       

      Show
      Replace the requirement with an explanation If a partner navigation property is specified, and this partner navigation property specifies the current navigation property as its partner, the two navigation properties define a bi-directional relationship. A partner navigation property may specify a navigation property different from the current navigation property.  

      Description

      Consider the following scenario:

      • Foo
        • allBar Type=Collection(Bar) Partner=foo
        • redBar Type=Collection(Bar) Partner=foo
        • greenBar Type=Collection(Bar) Partner=foo
      • Bar
        • foo Type=Foo Partner=allBar

      These partner navigation properties satisfy the basic rules

      If the partner navigation property is single-valued, it MUST lead back to the source entity from all related entities. If the partner navigation property is collection-valued, the source entity MUST be part of that collection.

      In addition this model clearly expresses that the pair (Foo/allBar, Bar/foo) forms a bi-directional relationship, and the other two navigation properties on Foo are uni-directional with a back-link.

      Unfortunately this model violates the last paragraph in CSDL section 8.3 Partner Navigation Property

      If a partner navigation property is specified, this partner navigation property MUST either specify the current navigation property as its partner to define a bi-directional relationship or it MUST NOT specify a partner navigation property. The latter can occur if the partner navigation property is defined on a complex type, or if the current navigation property is defined on a type derived from the type of the partner navigation property.

      A spec-compliant model would have to hide useful information, either

      • remove Partner=allBar from Bar/foo, or
      • remove Partner=foo from Foo/redBar and Foo/greenBar
         

        Attachments

          Activity

            People

            • Assignee:
              chrispre Christof Sprenger
              Reporter:
              handl Ralf Handl
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: