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

Michael Bolz commented on OLINGO-414:
-------------------------------------

Hi all,

I investigate more time in checking for the _to many_ case e.g.
http://localhost:8080/SalesOrderProcessing.svc/SalesOrders?$filter=SalesOrderLineItemDetails/delivered%20eq%20true

The problem is (as Chandan mentioned above) that the JPA Query is not correctly 
build with an according join.
So in the 
{{org/apache/olingo/odata2/jpa/processor/core/access/data/JPAQueryBuilder.java:176}}
 following JPQL is generated:
{code}
SELECT E1 FROM SalesOrderHeader E1 WHERE (E1.salesOrderItem.delivered = false) 
ORDER BY E1.soId
{code}

However correct would be following query:
{code}
SELECT E1 FROM SalesOrderHeader E1, SalesOrderItem e2 WHERE (e2.delivered = 
true and e2 MEMBER OF E1.salesOrderItem) ORDER BY E1.soId
{code}

Actual I think it is a higher effort necessary to fix this in a way that it 
works for all cases.
If I find the time I will try and give feedback.
In the meanwhile if some of you also works on this it would be very nice if you 
give feedback as well (so that we do not work twice).

Best Regards, Michael

> 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)

Reply via email to