Remove restriction on Partner navigation

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major
    • V4.02
    • Affects Version/s: V4.01_OS
    • Component/s: CSDL JSON, CSDL XML
    • None
    • 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.  

      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
         

            Assignee:
            chrispre
            Reporter:
            handl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: