- I am currently want to develop POC on UI5 application with OData from ASE 15.7 developer edition instead of SAP Netweaver Gateway.
- It is easy to configure ASE with OData on laptop (Win 7) and UI5 app. development for POC.
I discovered this issue, fields which have Foreign Key relationship is not included in metadata and as well output data (atom/xml or json)
Database "odata" and table 'SalesOrders' which is taken from "dotnet" example (\Sybase\ODATA-16_0\samples\dotnet\init.sql)
Column_name | Type | Length | Foreign Key |
ID | int | 4 | |
CustomerID | int | 4 | Employees.EmployeeID |
OrderDate | date | 4 | |
FinancialCode | char | 2 | FinancialCodes.Code |
Region | char | 7 | |
SalesRepresentative | int | 4 | Customers.ID |
Starting OData service for database "odata"
cmd> cd %sybase%\ODATA-16_0\samples\dotnet
cmd> ..\..\bin64\dbosrv16 DotNetConfig.properties
Metadata Service document --> missing properties CustomerId, FinancialCode and SalesRepresentative which are all fields has Foreign Key defined in the Table level
http://localhost:8090/odata/$metadata
<EntityTypeName="SalesOrders">
<PropertyRefName="ID"/>
</Key>
<PropertyName="ID"Type="Edm.Int32"Nullable="false"/>
<PropertyName="OrderDate"Type="Edm.DateTime"Nullable="false"Precision="0"/>
<PropertyName="Region"Type="Edm.String"Nullable="true"MaxLength="7"Collation="utf8"/>
<NavigationPropertyName="FK_CustomerID_ID"Relationship="SAPSybaseOData.SalesOrders_Customers_FK_CustomerID_ID"FromRole="SalesOrders_Customers_Source"ToRole="SalesOrders_Customers_Target"/>
<NavigationPropertyName="FK_FinancialCode_Code"Relationship="SAPSybaseOData.SalesOrders_FinancialCodes_FK_FinancialCode_Code"FromRole="SalesOrders_FinancialCodes_Source"ToRole="SalesOrders_FinancialCodes_Target"/>
<NavigationPropertyName="FK_SalesRepresentative_EmployeeID"Relationship="SAPSybaseOData.SalesOrders_Employees_FK_SalesRepresentative_EmployeeID"FromRole="SalesOrders_Employees_Source"ToRole="SalesOrders_Employees_Target"/>
<NavigationPropertyName="SalesOrderItems"Relationship="SAPSybaseOData.SalesOrders_SalesOrderItems_SalesOrderItems"FromRole="SalesOrders_SalesOrderItems_Source"ToRole="SalesOrders_SalesOrderItems_Target"/>
</EntityType>
Fetching SalesOrders data from OData endpoint, fields which have Foreign Key relationship not coming
http://localhost:8090/odata/SalesOrders?$format=json
{
"d" : {
"results" : [
{
"__metadata" : {
"uri" : "http://localhost:8090/odata/SalesOrders(2001)", "type" : "SAPSybaseOData.SalesOrders"
}, "ID" : 2001, "OrderDate" : "\/Date(953145000000)\/", "Region" : "Eastern", "FK_CustomerID_ID" : {
"__deferred" : {
"uri" : "http