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

Mirco Marchitiello (JIRA) issues at jboss.org
Fri Jun 24 15:07:00 EDT 2016


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

Mirco Marchitiello updated TEIID-4298:
--------------------------------------
        Description: 
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

    Forum Reference: https://developer.jboss.org/message/959195?et=watches.email.thread#959195


> 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: Steven Hawkins
>
> 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



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the teiid-issues mailing list