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!