OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (ODATA-606) Specify navigation property binding combined with containment


     [ https://tools.oasis-open.org/issues/browse/ODATA-606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralf Handl updated ODATA-606:
-----------------------------

    Description: 
This combination is not explicitly covered in the specification.

There are two sides to this problem: 
- target entity sets for contained entities
- contained entity sets as target entity sets

The first problem can be solved by allowing <NavigationPropertyBinding> elements as children of <NavigationProperty> elements that specify ContainsTarget="true": 
  <NavigationProperty Name="Items" Type="Collection(Model.OrderItem)" ContainsTarget="true">
    <NavigationPropertyBinding Path="Product" Target="Model.Container/Products"/>
  </NavigationProperty>

The second problem is trickier: assume an Order contains Items and Shipments, and an Item refers to a single Shipment of the same Order and vice versa. Using paths that start at the type defining the containment navigation property, the Target would be "Shipments" and "Items".
<EntityType Name="Order">
  <NavigationProperty Name="Items" Type="Collection(Model.OrderItem)" ContainsTarget="true">
    <NavigationPropertyBinding Path="Shipment" Target="Shipments"/>
  </NavigationProperty>
  <NavigationProperty Name="Shipments" Type="Collection(Model.Shipment)" ContainsTarget="true">
    <NavigationPropertyBinding Path="ShippedItems" Target="Items"/>
  </NavigationProperty>
</EntityType>

<EntityType Name="OrderItem">
  <NavigationProperty Name="Shipment" Type="Model.Shipment" Partner="ShippedItems"/>
</EntityType>

Slightly more complicated: Region contains SalesPeople and Customers, Customer has SalesRep that is a sales person from the same region. A Target can only be specified if Customer has a backlink to Region: Target="Region/SalesPeople".

So target paths are either relative and start with a sibling of the parent (navigation property within the same type, entity set within the same container) or absolute and start with a qualified schema name.

  was:
This combination is not explicitly covered in the specification.

There are two sides to this problem: 
- target entity sets for contained entities
- contained entity sets as target entity sets

The first problem can be solved by allowing <NavigationPropertyBinding> elements as children of <NavigationProperty> elements that specify ContainsTarget="true".

The second problem is trickier: assume an Order contains Items and Shipments, and an Item refers to a Shipment of the same Order and vice versa. Using paths that start at the type defining the containment navigation property, the Target would be "Shipments" and "Items".

Slightly more complicated: Region contains SalesPeople and Customers, Customer has SalesRep that is a sales person from the same region. A Target can only be specified if Customer has a backlink to Region: Target="Region/SalesPeople".


> Specify navigation property binding combined with containment
> -------------------------------------------------------------
>
>                 Key: ODATA-606
>                 URL: https://tools.oasis-open.org/issues/browse/ODATA-606
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: OData CSDL
>    Affects Versions: V4.0_OS
>            Reporter: Ralf Handl
>             Fix For: V4.0_ERRATA01
>
>
> This combination is not explicitly covered in the specification.
> There are two sides to this problem: 
> - target entity sets for contained entities
> - contained entity sets as target entity sets
> The first problem can be solved by allowing <NavigationPropertyBinding> elements as children of <NavigationProperty> elements that specify ContainsTarget="true": 
>   <NavigationProperty Name="Items" Type="Collection(Model.OrderItem)" ContainsTarget="true">
>     <NavigationPropertyBinding Path="Product" Target="Model.Container/Products"/>
>   </NavigationProperty>
> The second problem is trickier: assume an Order contains Items and Shipments, and an Item refers to a single Shipment of the same Order and vice versa. Using paths that start at the type defining the containment navigation property, the Target would be "Shipments" and "Items".
> <EntityType Name="Order">
>   <NavigationProperty Name="Items" Type="Collection(Model.OrderItem)" ContainsTarget="true">
>     <NavigationPropertyBinding Path="Shipment" Target="Shipments"/>
>   </NavigationProperty>
>   <NavigationProperty Name="Shipments" Type="Collection(Model.Shipment)" ContainsTarget="true">
>     <NavigationPropertyBinding Path="ShippedItems" Target="Items"/>
>   </NavigationProperty>
> </EntityType>
> <EntityType Name="OrderItem">
>   <NavigationProperty Name="Shipment" Type="Model.Shipment" Partner="ShippedItems"/>
> </EntityType>
> Slightly more complicated: Region contains SalesPeople and Customers, Customer has SalesRep that is a sales person from the same region. A Target can only be specified if Customer has a backlink to Region: Target="Region/SalesPeople".
> So target paths are either relative and start with a sibling of the parent (navigation property within the same type, entity set within the same container) or absolute and start with a qualified schema name.



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]