[teiid-issues] [JBoss JIRA] (TEIID-4298) Support in Odata4 for the Partner NavigationProperty attribute

Mirco Marchitiello (JIRA) issues at jboss.org
Tue Nov 29 07:11:00 EST 2016


     [ https://issues.jboss.org/browse/TEIID-4298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mirco Marchitiello reopened TEIID-4298:
---------------------------------------


After the correction the following behaviour is correct:

Standard odata4:
http://services.odata.org/V4/Northwind/Northwind.svc/Categories(7)/Products

Teiid:
http:/localhost:8080/odata4/NORTHWIND.1/Northwind/Categories(7)/Products_FK_Products_Categories?$format=json

Anyway the following behaviour is still not permitted

Standard odata4:
http://services.odata.org/V4/Northwind/Northwind.svc/Products(51)/Category/Products

Teiid:
http://localhost:8080/odata4/NORTHWIND.1/Northwind/Products(51)/Category/Products?$format=json

The message returned is
The property 'Products' must not follow a collection

I tried to change the properties
foreignKeyMultiplicity
primaryKeyMultiplicity

of the foreign key between Products and Categories with no success



> Support in Odata4 for the Partner NavigationProperty attribute
> --------------------------------------------------------------
>
>                 Key: TEIID-4298
>                 URL: https://issues.jboss.org/browse/TEIID-4298
>             Project: Teiid
>          Issue Type: Enhancement
>          Components: OData
>    Affects Versions: 9.0
>            Reporter: Mirco Marchitiello
>            Assignee: Ramesh Reddy
>             Fix For: 9.1
>
>
> in Teiid 9.0 it would be useful to create a bidirectional link between tables, like in odata2
> for example:
> <EntityType Name="Product">
>     <Key>
>         <PropertyRef Name="ProductID"/>
>     </Key>
>     <Property Name="ProductID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity"/>
>     <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40"/>
>     <Property Name="SupplierID" Type="Edm.Int32"/>
>     <Property Name="CategoryID" Type="Edm.Int32"/>
>     <Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20"/>
>     <Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4"/>
>     <Property Name="UnitsInStock" Type="Edm.Int16"/>
>     <Property Name="UnitsOnOrder" Type="Edm.Int16"/><Property Name="ReorderLevel" Type="Edm.Int16"/>
>     <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false"/>
>     <NavigationProperty Name="Category" Type="NorthwindModel.Category" Partner="Products">
>         <ReferentialConstraint Property="CategoryID" ReferencedProperty="CategoryID"/>
>     </NavigationProperty>
>     <NavigationProperty Name="Order_Details" Type="Collection(NorthwindModel.Order_Detail)" Partner="Product"/>
>     <NavigationProperty Name="Supplier" Type="NorthwindModel.Supplier" Partner="Products">
>         <ReferentialConstraint Property="SupplierID" ReferencedProperty="SupplierID"/>
>     </NavigationProperty>
> </EntityType>
> <EntityType Name="Category">
>     <Key>
>         <PropertyRef Name="CategoryID"/>
>     </Key>
>     <Property Name="CategoryID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity"/>
>     <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15"/>
>     <Property Name="Description" Type="Edm.String" MaxLength="max"/>
>     <Property Name="Picture" Type="Edm.Binary" MaxLength="max"/>
>     <NavigationProperty Name="Products" Type="Collection(NorthwindModel.Product)" Partner="Category"/>
> </EntityType>
> It seems that the two tables are related through NavigationProperty and Partner
> In fact I can see all the Categories of a certain Product
> http://services.odata.org/V4/Northwind/Northwind.svc/Products(10)/Category
> or viceversa the products of a certain Category
> http://services.odata.org/V4/Northwind/Northwind.svc/Categories(8)/Products
> While in Teiid using odata2 this works just by creating a FK from one table to the other one, with odata4 this does not happen



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the teiid-issues mailing list