You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Chus Picos <mp...@denodo.com> on 2016/06/23 16:03:48 UTC
Inherited Entities
Hi,
I am dealing with entities that have a base type and I have a doubt about
the projection of the properties.
This is a sample:
http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons
In the response there are two customers and two employees. You can use
$select=* in the request and the response will be the same but I have not
found the syntax to specify the customer properties or employee properties.
I mean, I want to know if it is possible to do something like this:
http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons?$select=ID,Name,TotalExpense,HireDate
Thanks and regards.
--
Re: Inherited Entities
Posted by "Bolz, Michael" <mi...@sap.com>.
Hi,
as described here [1] you can cast to the desired type and then select the property:
http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons/ODataDemo.Employee/?$select=Salary <http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons/ODataDemo.Employee/?$select=Salary>
An selection for the Employee/Salary will lead to an exception:
http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons?$select=ODataDemo.Employee/Salary <http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons?$select=ODataDemo.Employee/Salary>
Kind Regards,
Michael
[1]: http://docs.oasis-open.org/odata/odata/v4.0/cs01/part2-url-conventions/odata-v4.0-cs01-part2-url-conventions.html#_Addressing_Derived_Types <http://docs.oasis-open.org/odata/odata/v4.0/cs01/part2-url-conventions/odata-v4.0-cs01-part2-url-conventions.html#_Addressing_Derived_Types>
> On 23 Jun 2016, at 18:03, Chus Picos <mp...@denodo.com> wrote:
>
> Hi,
>
> I am dealing with entities that have a base type and I have a doubt about the projection of the properties.
>
> This is a sample: http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons <http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons>
>
> In the response there are two customers and two employees. You can use $select=* in the request and the response will be the same but I have not found the syntax to specify the customer properties or employee properties. I mean, I want to know if it is possible to do something like this:
>
> http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons?$select=ID,Name,TotalExpense,HireDate <http://services.odata.org/V4/OData/(S(h3pggazgkuei3wtiwn3aeclv))/OData.svc/Persons?$select=ID,Name,TotalExpense,HireDate>
>
> Thanks and regards.
>
>
> --
>
>