You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Diego dos Santos (JIRA)" <ji...@apache.org> on 2018/03/06 18:46:00 UTC

[jira] [Commented] (OLINGO-1118) Filter on Enum field doesn't work

    [ https://issues.apache.org/jira/browse/OLINGO-1118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16388287#comment-16388287 ] 

Diego dos Santos commented on OLINGO-1118:
------------------------------------------

 I am having the same issue with V2 2.0.10, but the message is 'OData - JPA Runtime: JPA query syntax is not correct'.

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
(v7.6.3#76005)