[ 
https://issues.apache.org/jira/browse/OLINGO-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christian Amend resolved OLINGO-930.
------------------------------------
    Resolution: Duplicate
      Assignee: Christian Amend

Hi Darren,

this is a known issue and currently not supported. The original issue is this: 
https://issues.apache.org/jira/browse/OLINGO-414

I will change the error message for this to better reflect the current status. 
If you have any contributions to speed up this feature we would be very 
grateful.

> Filter condition on an expanded attribute fails with ClassCastException
> -----------------------------------------------------------------------
>
>                 Key: OLINGO-930
>                 URL: https://issues.apache.org/jira/browse/OLINGO-930
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.5, V2 2.0.6
>            Reporter: Darren Lindley
>            Assignee: Christian Amend
>
> i installed the sample cars/manufacturers application and tried this query:
> http://localhost:8080/MyFormula.svc/Cars?$filter=ManufacturerDetails/Name%20eq%20%27SuperCar%27&$expand=ManufacturerDetails
> this fails with the message:
> class java.lang.ClassCastException : 
> org.apache.olingo.odata2.core.edm.provider.EdmNavigationPropertyImplProv 
> cannot be cast to org.apache.olingo.odata2.api.edm.EdmProperty
> This appears to come from ODataExpressionParser:
> {code:title=ODataExpressionParser.java|borderStyle=solid}
>   private static String getPropertyName(final CommonExpression 
> whereExpression) throws EdmException {
>     EdmProperty property = ((EdmProperty) ((PropertyExpression) 
> whereExpression).getEdmProperty());
>     EdmMapping mapping = property.getMapping();
>     String name = mapping != null ? mapping.getInternalName() : 
> property.getName();
>     return name;
>   }
> {code}
> changing this to :
> {code:title=ODataExpressionParser.java|borderStyle=solid}
>   private static String getPropertyName(final CommonExpression 
> whereExpression) throws EdmException {
>     EdmTyped edmTyped = ((PropertyExpression) 
> whereExpression).getEdmProperty();
>     EdmMapping mapping = ((EdmMappable) edmTyped).getMapping();
>     return mapping != null ? mapping.getInternalName() : edmTyped.getName();
>   }
> {code}
> resolves the issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to