cancel
Showing results for 
Search instead for 
Did you mean: 

OData protocol doesn't include Foreign Key fields in metadata and as well in data

Sathees_P
Participant
0 Kudos

- 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_nameTypeLengthForeign Key
IDint4
CustomerIDint4Employees.EmployeeID
OrderDatedate4
FinancialCodechar2FinancialCodes.Code
Regionchar7
SalesRepresentativeint4Customers.ID

Starting OData service for database "odata"

cd %sybase%\ODATA-16_0\samples\dotnet

..\..\bin64\dbosrv16 DotNetConfig.properties

http://localhost:8090/odata/$metadata

<EntityType Name="SalesOrders">

<Key>

<PropertyRef Name="ID"/>

</Key>

<Property Name="ID" Type="Edm.Int32" Nullable="false"/>

<Property Name="OrderDate" Type="Edm.DateTime" Nullable="false" Precision="0"/>

<Property Name="Region" Type="Edm.String" Nullable="true" MaxLength="7" Collation="utf8"/>

<NavigationProperty Name="FK_CustomerID_ID" Relationship="SAPSybaseOData.SalesOrders_Customers_FK_CustomerID_ID" FromRole="SalesOrders_Customers_Source" ToRole="SalesOrders_Customers_Target"/>

<NavigationProperty Name="FK_FinancialCode_Code" Relationship="SAPSybaseOData.SalesOrders_FinancialCodes_FK_FinancialCode_Code" FromRole="SalesOrders_FinancialCodes_Source" ToRole="SalesOrders_FinancialCodes_Target"/>

<NavigationProperty Name="FK_SalesRepresentative_EmployeeID" Relationship="SAPSybaseOData.SalesOrders_Employees_FK_SalesRepresentative_EmployeeID" FromRole="SalesOrders_Employees_Source" ToRole="SalesOrders_Employees_Target"/>

<NavigationProperty Name="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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You might want to open an incident with SAP tech support.

Cheers,

-Paul

Answers (1)

Answers (1)

0 Kudos

I am one of the developers on the team. This behavior is intentional and not a bug in the first release of odata producer. Please contact me directly if you have further questions.

Thanks

Mahesh

Sathees_P
Participant
0 Kudos

Hello Mahesh,

Thanks for your reply.

I have a transaction table, in which I need to update some Foreign Key fields. But these fields not available in OData metadata nor in data. I could not able to proceed further.

But SAP Netweaver Gateway I am not facing like this issue.

Please enable this feature in ASE 15.7 OData Producer and it will enable many to proceed towards POC development in nice ASE 15.7 database.