You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Michael Bolz (JIRA)" <ji...@apache.org> on 2014/09/01 11:15:20 UTC

[jira] [Updated] (OLINGO-414) Cannot Filter on Navigation Property

     [ https://issues.apache.org/jira/browse/OLINGO-414?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bolz updated OLINGO-414:
--------------------------------
    Attachment: olingo-414-patch.diff
                olingo-414-exception.diff

Hi,

I investigated this issue and found the problem in the {{ODataExpressionParser}} line {{~155ff}}.

There could also other {{EdmTyped}} objects be returned then {{EdmProperty}}.
But after change this into a {{EdmMappable}} (see attach *Patch.diff*) the generated {{JPQL}} expression is not correct for {{NavigationProperties}} (see attached *Exception information*).

So if the JPA Processor only supports {{EdmProperty}} the 
{{if(property instanceof EdmMappable)}}
should be replaced by a 
{{if(property instanceof EdmProperty)}}.

[~chandan.v.a]: Does (or should) the JPA-Processor support such a use case?

Kind regards,
Michael

Test call URL for local deployed JPA-Processor-Ref-Scenario:
http://localhost:8080/SalesOrderProcessing.svc/Customers?$filter=id%20eq%20100%20and%20orders/currencyCode%20eq%20%27USD%27&odata-debug=json

> Cannot Filter on Navigation Property
> ------------------------------------
>
>                 Key: OLINGO-414
>                 URL: https://issues.apache.org/jira/browse/OLINGO-414
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.0
>            Reporter: Simon Carroll
>            Assignee: Michael Bolz
>         Attachments: olingo-414-exception.diff, olingo-414-patch.diff
>
>
> We are receiving an error when we try to filter on a navigation property.  In our solution we have a Notification entity and a User entity, we would like to retrieve a specific Notification but only if it is linked to the requesting user.  This would involve an ODATA request which filters on both the UserId and the NotificationId.  An example of the URL we are invoking is:
> dspplatform.svc/Notifications?$filter=NotificationId%20eq%204%20and%20UserDetails/UserId%20eq%202
> This returns the following error:
> org.apache.olingo.odata2.core.edm.provider.EdmNavigationPropertyImplProv cannot be cast to org.apache.olingo.odata2.api.edm.EdmProperty
> Can you please advise on how to perform filters on a Navigation property as we need this as part of our core functionality?



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