You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Melissa Ibeth Vargas Lobo (JIRA)" <ji...@apache.org> on 2016/08/26 04:08:20 UTC

[jira] [Commented] (OLINGO-972) EntityType with Basetype, doesn't inherit a Function of the BaseType.

    [ https://issues.apache.org/jira/browse/OLINGO-972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15438441#comment-15438441 ] 

Melissa Ibeth Vargas Lobo commented on OLINGO-972:
--------------------------------------------------

Hi,

I append the patch file created to resolve this issue.

> EntityType with Basetype, doesn't inherit a Function of the BaseType.
> ---------------------------------------------------------------------
>
>                 Key: OLINGO-972
>                 URL: https://issues.apache.org/jira/browse/OLINGO-972
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-server
>    Affects Versions: (Java) V4 4.2.0
>            Reporter: Melissa Ibeth Vargas Lobo
>         Attachments: 0001-OLINGO-972-EntityType-with-Basetype-doesn-t-inherit-.patch
>
>
> This is my BaseEntity:
> <EntityType Name="BaseEntity" Abstract="true">
> <Key>
> <PropertyRef Name="ID"/>
> </Key>
> <Property Name="ID" Type="Edm.Int64"/>
> </EntityType>
> This entity has the next Function:
> <Function Name="GetInvoices" IsBound="true" IsComposable="true">
> <Parameter Name="entity" Type="ns.BaseEntity" Nullable="false"/>
> <Parameter Name="param" Type="Edm.String" Nullable="false"/>
> <ReturnType Type="Collection(Edm.String)"/>
> </Function>
> Now, I have an Entity which has a Basetype:
> <EntityType Name="Hotel" BaseType="ns.BaseEntity">
> <Property Name="Name" Type="Edm.String"/>
> <Property Name="Description" Type="Edm.String"/>
> <Property Name="Picture" Type="Edm.String"/>
> <Property Name="Location" Type="Edm.String"/>
> <Property Name="AvailableStartDate" Type="Edm.DateTimeOffset"/>
> <Property Name="AvailableEndDate" Type="Edm.DateTimeOffset"/>
> <Property Name="City" Type="ns.City"/>
> <NavigationProperty Name="ReviewBooking" Type="ns.ReviewBooking" Nullable="false"/>
> </EntityType>
> <EntitySet Name="MyHotels" EntityType="ns.Hotel">
> <NavigationPropertyBinding Path="ReviewBooking" Target="ReviewBooking"/>
> </EntitySet>
> So, when I try to use the Function GetInvoices:
> http://localhost:8080/ODataService/MyHotels(103)/ns.GetInvoices(param='Name')
> The response is:
> <error xmlns="http://docs.oasis-open.org/odata/ns/metadata">
> <code>null</code>
> <message>The part 'ns.GetInvoices' is not defined.</message>
> </error>
> __________________
> I don't know if it's possible, if the Basetype Entity 'B' has a Function 'F', another Entity 'A' that has as BaseType 'B' can use the function 'F'.
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)