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

dhaval gupta commented on OLINGO-414:
-------------------------------------

Hi Chandan

In current implementation of olingo this is how JPQL works :
 - For the parent entity a query is fired with $filter values appended in the 
where clause of the query formed by Odata JPA processor and for fetching the 
navigation property a query is fired for every parent with where clause having 
the primary key of the parent .

-All we need to do in the current implementation is to add additional 
parameters in the where clause corresponding to the navigation property along 
with the primary key of the parent for every navigation query fired.

This approach does not require constructing JPQL statements with joins ? Isn't 
it ? (Which you mentioned in your 1st approach)

2nd approach is anyways out of question as we pay the cost to fetch the 
database records and then applying filter on top of that.

Thanks
Dhaval.

> 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: Chandan V.A
>         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)

Reply via email to