[
https://issues.apache.org/jira/browse/OLINGO-517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14242282#comment-14242282
]
Fadhly commented on OLINGO-517:
-------------------------------
There is a fix to this bug. I've already test it works.
just fix this class: ODataExpressionParser
line 170 change to:
memberExpStr =
((EdmNavigationProperty) ((PropertyExpression)
tempExp).getEdmProperty()).getMapping().getInternalName()
+ JPQLStatement.DELIMITER.PERIOD + memberExpStr;
> Expand and filter bug
> ---------------------
>
> Key: OLINGO-517
> URL: https://issues.apache.org/jira/browse/OLINGO-517
> Project: Olingo
> Issue Type: Bug
> Components: odata2-jpa
> Affects Versions: V2 2.0.1
> Environment: Windows, Linux
> Reporter: Fadhly
>
> Consider two entities, Person and Gender which Person maps Gender as
> unidirectional ManyToOne
> I run this query:
> http://...odata/Persons?$expand=gender&$filter=gender/gender eq 'Male'
> I got this exception:
> Caused by: java.lang.ClassCastException:
> org.apache.olingo.odata2.core.edm.provider.EdmNavigationPropertyImplProv
> cannot be cast to org.apache.olingo.odata2.api.edm.EdmProperty
> at
> org.apache.olingo.odata2.jpa.processor.core.ODataExpressionParser.parseToJPAWhereExpression(ODataExpressionParser.java:169)
> at
> org.apache.olingo.odata2.jpa.processor.core.ODataExpressionParser.parseToJPAWhereExpression(ODataExpressionParser.java:105)
> at
> org.apache.olingo.odata2.jpa.processor.core.ODataExpressionParser.parseToJPAWhereExpression(ODataExpressionParser.java:106)
> at
> org.apache.olingo.odata2.jpa.processor.core.ODataExpressionParser.parseToJPAWhereExpression(ODataExpressionParser.java:96)
> at
> org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectContext$JPQLSelectContextBuilder.generateWhereExpression(JPQLSelectContext.java:159)
> at
> org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectContext$JPQLSelectContextBuilder.build(JPQLSelectContext.java:109)
> at
> org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.process(JPAProcessorImpl.java:154)
> ... 71 more
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)