[
https://issues.apache.org/jira/browse/OLINGO-847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Amend resolved OLINGO-847.
------------------------------------
Resolution: Fixed
Assignee: Christian Amend
Hi Joshi,
here the answer I wrote on the mailing list for reference:
within the visitMember method you will have access to the kind of property
which was addressed. For example our testing scenario throws a “not
implemented” in this case as shown in this code:
CommonExpression currentExpression = memberExpression;
while (currentExpression != null) {
final PropertyExpression currentPropertyExpression =
(PropertyExpression) (currentExpression.getKind() ==
ExpressionKind.MEMBER ?
((MemberExpression) currentExpression).getProperty() :
currentExpression);
final EdmTyped currentProperty =
currentPropertyExpression.getEdmProperty();
final EdmTypeKind kind = currentProperty.getType().getKind();
if (kind == EdmTypeKind.SIMPLE || kind == EdmTypeKind.COMPLEX) {
propertyPath.add(0, (EdmProperty) currentProperty);
} else {
throw new ODataNotImplementedException();
}
currentExpression =
currentExpression.getKind() == ExpressionKind.MEMBER ?
((MemberExpression) currentExpression).getPath()
: null;
}
Instead in your code you would need to follow the path which leads you to the
addressed navigation property.
Best Regards,
Christian
> How to implement ExpressionVisitor for secondary entities in OData 2.0 ?
> ------------------------------------------------------------------------
>
> Key: OLINGO-847
> URL: https://issues.apache.org/jira/browse/OLINGO-847
> Project: Olingo
> Issue Type: Question
> Reporter: Prathamesh Joshi
> Assignee: Christian Amend
> Priority: Critical
> Labels: Odata, Olingo
>
> Hi all,
> I have Odata service implemented which takes URL request and then fetches
> corresponding data from service layer. I have implemented ExpressionVisitor
> for extracting filter criteria from Odata URL. It works fine for simple
> entities but when I apply filter to a field of nested entity
> ExpressionVisitor doesnt identifies it. Is there any way to identify nested
> entities filter operation ?
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)