[
https://issues.apache.org/jira/browse/OLINGO-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16950959#comment-16950959
]
Augusto Klein commented on OLINGO-1118:
---------------------------------------
Hello, Im having this same issue now while trying to do a expand & filter
expression
E.g: xITSPDSFAxA_SalesOrdersItens?
$expand=to_xITSPDSFAxA_SalesOrders
&$filter=to_xITSPDSFAxA_SalesOrders/SalesOrderStatus eq 'PAID'
where the entity expanded is xITSPDSFAxA_SalesOrders and SalesOrderStatus is a
enum.
Error: <message xml:lang="en">java.lang.String cannot be cast to
java.lang.Enum</message>
Can someone help us?
> Filter on Enum field doesn't work
> ---------------------------------
>
> Key: OLINGO-1118
> URL: https://issues.apache.org/jira/browse/OLINGO-1118
> Project: Olingo
> Issue Type: Bug
> Components: odata2-jpa
> Affects Versions: V2 2.0.7
> Reporter: Shankara
> Priority: Major
>
> Hi,
> We've an Enum field for an entity which is shown as Edm.String in metadata.
> When we do a filter on a a field which has Enum as field type it throws an
> error saying cannot cast String to Enum.
> Medata:
> <EntityType Name="ExtendedActivation">
> <Key>
> <PropertyRef Name="ConfigurationType"/>
> <PropertyRef Name="Id"/>
> </Key>
> <Property Name="ConfigurationType" Type="Edm.String" Nullable="false"
> MaxLength="255"/>
> <Property Name="ConfigurationXml" Type="Edm.String" Nullable="false"
> MaxLength="2147483647"/>
> <Property Name="Id" Type="Edm.String" Nullable="false" MaxLength="45"/>
> </EntityType>
> OData Filter Call: <Odata serivce base
> url>//ExtendedActivations?$filter=ConfigurationType eq 'GENERIC_TYPE'
> Exception:
> Internal Exception: java.lang.ClassCastException: Cannot cast class
> java.lang.String to class java.lang.Enum
> Query: ReadAllQuery(referenceClass=ExtendedActivation jpql="SELECT E1 FROM
> ExtendedActivation E1 WHERE (E1.configurationType = 'GENERIC_TYPE')")
> Thanks & Regards
> Shankara G
--
This message was sent by Atlassian Jira
(v8.3.4#803005)