[
https://issues.apache.org/jira/browse/OLINGO-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16177790#comment-16177790
]
Michael Bolz commented on OLINGO-1146:
--------------------------------------
The problem seems to be a to strict check in filter parsing:
{{org/apache/olingo/odata2/core/uri/expression/FilterParserImpl.java:509}}
When the new code for to many check is commented out all works as before:
{code}
if (edmProperty != null) {
property.setEdmProperty(edmProperty);
property.setEdmType(edmProperty.getType());
// if (edmProperty.getMultiplicity() == EdmMultiplicity.MANY) {
// throw new ExpressionParserException(
// ExpressionParserException.INVALID_MULTIPLICITY.create()
// .addContent(propertyName)
// .addContent(propertyToken.getPosition() + 1));
// }
} else {
{code}
Currently I guess the filter must be adapted that only the last part of a
filter literal is checked for multiplicity (e.g. "delivered" of
"SalesOrderLineItemDetails/delivered eq true").
But this must be checked.
Regards, Michael
> CLONE - Cannot Filter on Navigation Property
> --------------------------------------------
>
> Key: OLINGO-1146
> URL: https://issues.apache.org/jira/browse/OLINGO-1146
> Project: Olingo
> Issue Type: Bug
> Components: odata2-jpa
> Affects Versions: V2 2.0.0
> Reporter: igor nemtsov
> Assignee: Michael Bolz
> Fix For: V2 2.0.8
>
> Attachments: olingo-414-exception.diff, olingo-414-patch.diff,
> olingo-odata2-parent.patch
>
>
> 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.4.14#64029)