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

Recursive containment navigation properties and Partner attribute

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_ERRATA03
    • Fix Version/s: V4.01_WD01
    • Component/s: CSDL XML
    • Labels:
      None
    • Proposal:
      Hide

      Clarify prose text:

      Containment navigation properties MAY specify a Partner attribute. If the containment is recursive, the relationship defines a tree; thus the navigation property on the type defined as the partner MUST specify a single entity type and MUST be nullable (for the root of the tree). If the containment is not recursive, the partner navigation property MUST NOT be nullable because it leads back to the containing entity.

      An entity type inheritance chain MUST NOT contain more than one navigation property with a Partner attribute referencing a containment relationship.

      Current prose text:

      Containment navigation properties MAY specify a Partner attribute. If the containment is recursive, the partner navigation property MUST be nullable and specify a single entity type. If the containment is not recursive, the partner navigation property MUST NOT be nullable.

      An entity type hierarchy MUST NOT contain more than one navigation property with a Partner attribute referencing a containment relationship.

      Show
      Clarify prose text: Containment navigation properties MAY specify a Partner attribute. If the containment is recursive, the relationship defines a tree; thus the navigation property on the type defined as the partner MUST specify a single entity type and MUST be nullable (for the root of the tree). If the containment is not recursive, the partner navigation property MUST NOT be nullable because it leads back to the containing entity. An entity type inheritance chain MUST NOT contain more than one navigation property with a Partner attribute referencing a containment relationship. Current prose text: Containment navigation properties MAY specify a Partner attribute. If the containment is recursive, the partner navigation property MUST be nullable and specify a single entity type. If the containment is not recursive, the partner navigation property MUST NOT be nullable. An entity type hierarchy MUST NOT contain more than one navigation property with a Partner attribute referencing a containment relationship.

      Description

      An entity cannot be referenced by more than one containment relationship, and cannot both belong to an entity set declared within the entity container and be referenced by a containment relationship.

      Current rules around recursive containment and partner navigation properties seem to be sufficient to achieve this goal. but may not be necessary, i.e. seem overly restrictive.

      A counter-example to the current rules can be constructed by redefining a partner navigation property with a more specific type, which is allowed now:

      • EntityType Name=FileSystemEntry
      • NavigationProperty Name=Parent Type=this.FileSystemEntry Nullable=true
      • EntityType Name=Folder BaseType=this.FileSystemEntry
      • NavigationProperty Name=Children Type=Collection(this.FileSystemEntry) Partner=Parent
      • EntityType Name=File BaseType=this.FileSystemEntry
      • NavigationProperty Name=Parent Type=this.Folder Nullable=false

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              handl Ralf Handl
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: