[
https://issues.jboss.org/browse/TEIID-4298?page=com.atlassian.jira.plugin...
]
Ramesh Reddy resolved TEIID-4298.
---------------------------------
Fix Version/s: 9.2
(was: 9.1)
Resolution: Done
Labels: alpha2 (was: )
Previous fix was not complete. While in one-2-one situations it was fine, but not in
many-2-one situation, where in this example
product -> category (many-to-one) but navigation is one product to one category
category to product (one-2-many) navigation one category to many products.
so as long as navigation with out key construct is not set a collection type, you can keep
of walking the tree.
BTW, your last URL is wrong too, Teiid always uses the FK name for the navigation. Check
the metadata for its name.
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
Labels: alpha2
Fix For: 9.2
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)