Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

OData $filter on expanded association

$
0
0

Hello,

 

I have a question regarding how to filter an odata principal object based on criteria in associated objects.  For example, my service exposes Customers and Orders, where there's a 1-n association.  Here's the service definition:

 

service {        "com.example::Customers" as "Customer" keys ("ID")            navigates ("Customer_Orders" as "Orders" from principal);            "com.example::Orders" as "Order" keys ("ORDER_ID");      association "Customer_Orders" principal "Customer"("ID") multiplicity "1" dependent "Orders"("CUSTOMER_ID") multiplicity "*";
}

 

What I want to do is find any customers that have any orders with Type equal to "airmail". According to this stackoverflow answer, my request path should look like the following:

 

/Example.xsodata/Customer?$format=json&$expand=Orders&$filter=Orders/any(o: o/Type eq 'airmail')

 

This doesn't work. I'm wondering whether HANA supports this functionality, or if it is an error on my part?  I understand that HANA supports a limited subset of odata filter functionality.

 

Thanks!


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>